@@ -83,20 +83,25 @@ Logger.configure_backend(RingLogger, max_size: 1024)
8383See the example project for a hands-on walk-through of using the logger. Read on
8484for the highlights.
8585
86- Log messages aren't printed to the console by default. If you're seeing them,
87- they may be coming from Elixir's default ` :console ` logger.
86+ For the purpose of the example, when you're in IEx, log messages shouldn't be
87+ printed to the console by default. They'll be coming from the console logger, so
88+ turn them off:
8889
89- To see log messages as they come in, call ` RingLogger.attach() ` and then to make
90- the log messages stop, call ` RingLogger.detach() ` . The ` attach ` method takes
91- options if you want to limit the log level, change the formatting, etc.
90+ ``` elixir
91+ iex> Logger .remove_backend (:console )
92+ :ok
93+ ```
94+
95+ To see log messages as they come in with RingLogger, call ` RingLogger.attach() `
96+ and then to make the log messages stop, call ` RingLogger.detach() ` . The ` attach `
97+ method takes options if you want to limit the log level, change the formatting,
98+ etc.
9299
93100Here's an example:
94101
95102``` elixir
96103iex> Logger .add_backend (RingLogger )
97104{:ok , # PID<0.199.0>}
98- iex> Logger .remove_backend (:console )
99- :ok
100105iex> RingLogger .attach
101106:ok
102107iex> require Logger
@@ -106,11 +111,8 @@ iex> Logger.info("hello")
10611114 :04 :52 .516 [info] hello
107112```
108113
109- This probably isn't too exciting until you see that it works on remote shells as
110- well (the ` :console ` logger doesn't do this).
111-
112- Say you prefer polling for log messages rather than having them print over your
113- console at random times. If you're still attached, then ` detach ` and ` next ` :
114+ If you prefer polling for log messages rather than having them print when they
115+ show up. If you're still attached, then ` detach ` and ` next ` :
114116
115117``` elixir
116118iex> RingLogger .detach
@@ -152,6 +154,17 @@ iex> RingLogger.grep(~r/[Nn]eedle/)
15215416 :55 :41 .614 [info] Needle in a haystack
153155```
154156
157+ ## RingLogger TUI
158+
159+ RingLogger provides a simple text UI that lets you access log viewing features
160+ in a friendly way.
161+
162+ ``` elixir
163+ iex> RingLogger .viewer ()
164+ ```
165+
166+ Type ` h ` and then enter for help.
167+
155168## Module and Application Level Filtering
156169
157170If you want to filter a module or modules at a particular level you pass a map
0 commit comments