@@ -39,12 +39,12 @@ If it was to be defined in a compositional way,
3939we would write something along the lines of:
4040```
4141ConsoleLogger(stream, min_level) =
42- MinLevelLogger(
43- ActiveFilteredLogger(max_log_filter,
44- PureConsoleLogger(stream)
45- ),
46- min_level
47- )
42+ MinLevelLogger(
43+ ActiveFilteredLogger(max_log_filter,
44+ PureConsoleLogger(stream)
45+ ),
46+ min_level
47+ )
4848```
4949
5050
@@ -60,7 +60,7 @@ For full details, see the [Julia documentation on Logging](https://docs.julialan
6060To use a ` logger ` in a given scope do
6161```
6262with_logger(logger) do
63- #things
63+ #things
6464end
6565```
6666
@@ -119,17 +119,17 @@ and warnings and above to another.
119119julia> using Logging; using LoggingExtras;
120120
121121julia> demux_logger = DemuxLogger(
122- MinLevelLogger(FileLogger("info.log"), Logging.Info),
123- MinLevelLogger(FileLogger("warn.log"), Logging.Warn),
122+ MinLevelLogger(FileLogger("info.log"), Logging.Info),
123+ MinLevelLogger(FileLogger("warn.log"), Logging.Warn),
124124 include_current_global=false
125125);
126126
127127
128128julia> with_logger(demux_logger) do
129- @warn("It is bad")
130- @info("normal stuff")
131- @error("THE WORSE THING")
132- @debug("it is chill")
129+ @warn("It is bad")
130+ @info("normal stuff")
131+ @error("THE WORSE THING")
132+ @debug("it is chill")
133133end
134134
135135shell> cat warn.log
@@ -160,17 +160,17 @@ We want to filter to only log strings staring with `"Yo Dawg!"`.
160160
161161```
162162julia> function yodawg_filter(log_args)
163- startswith(log_args.message, "Yo Dawg!")
163+ startswith(log_args.message, "Yo Dawg!")
164164end
165165 yodawg_filter (generic function with 1 method)
166166
167167julia> filtered_logger = ActiveFilteredLogger(yodawg_filter, global_logger());
168168
169169julia> with_logger(filtered_logger) do
170- @info "Boring message"
171- @warn "Yo Dawg! it is bad"
172- @info "Another boring message"
173- @info "Yo Dawg! it is all good"
170+ @info "Boring message"
171+ @warn "Yo Dawg! it is bad"
172+ @info "Another boring message"
173+ @info "Yo Dawg! it is all good"
174174end
175175┌ Warning: Yo Dawg! it is bad
176176└ @ Main REPL[28]:3
@@ -307,12 +307,12 @@ using HTTP
307307
308308transformer_logger(global_logger()) do log
309309 if log._module == HTTP && log.level=Logging.Debug
310- # Merge can be used to construct a new NamedTuple
311- # which effectively is the overwriting of fields of a NamedTuple
312- return merge(log, (; level=Logging.Info))
313- else
314- return log
315- end
310+ # Merge can be used to construct a new NamedTuple
311+ # which effectively is the overwriting of fields of a NamedTuple
312+ return merge(log, (; level=Logging.Info))
313+ else
314+ return log
315+ end
316316end
317317
318318global_logger(transformer_logger)
0 commit comments