Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Auto-attach without clobbering iex prompt in dev env #73

Open
axelson opened this issue Nov 29, 2021 · 0 comments
Open

Comments

@axelson
Copy link
Contributor

axelson commented Nov 29, 2021

Note: I'm extracting this from a conversation with Frank on Slack so that we don't lose the conversation history.

I would like a feature that would allow ring_logger to automatically attach to an IEx prompt without clobbering the iex prompt. I have a proof-of-concept here (note that it uses OTP internals... as does Elixir):
axelson@85e22f3

The reason I want this is because when working on Elixir applications (such as a phoenix app) I almost always use iex -S mix phx.server and any logger output from the application will overwrite my IEx prompt and I cannot see what I am typing.

I was thinking of submitting this as a PR to ring_logger but it might be out of scope. So maybe it would make more sense to fork ring_logger instead (the new name might be something like dev_logger).

I have a couple other features in mind for dev_logger, like an optional Phoenix integration that would allow you to see and search your logs in the browser (this could be done as a Phoenix LiveDashboard integration (which Frank suggested)).

We also discussed integrating via .iex.exs but philosophically I’d personally prefer to avoid that. Partially because some projects may gitignore the .iex.exs and I just feel that the contents in there should be very specific to the project rather than “configuring” libraries. And if not written carefully it will cause a iex (instead of iex -S mix) in that directory to fail.

From Frank:

RingLogger is showing its age, and my original thought was to rewrite it to use Erlang’s logger. I did that, but it has usability issues that need to be addressed.
Having said that, I removed the “attach” functionality from the Erlang version. The reason was that I was able to do it more simply in Toolshed. See log_attach and log_detach.

So I'm not sure exactly where we stand at this point. I guess my question is still: Does it make sense to integrate an auto-attach to IEx in development within RingLogger? Or should I create a new library instead?

Although in either case I'd like to add an optional Phoenix LiveDashboard integration for RingLogger (and DevLogger if it exists) that would show and allow searching of the logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant