@@ -153,7 +153,7 @@ see the HTTP example below.
153153Another example is using them to stop messages every being repeated within a given time period.
154154
155155``` julia
156- using Dates, Logging, LoggingExtras
156+ using Dates, LoggingExtras
157157
158158julia> function make_throttled_logger (period)
159159 history = Dict {Symbol, DateTime} ()
@@ -195,7 +195,7 @@ that just checks if the level of the message is above the level specified when i
195195### Demo: filter out all the log messages that are less severe than `Error`
196196
197197``` julia
198- julia> using Logging, LoggingExtras
198+ julia> using LoggingExtras
199199
200200julia> error_only_logger = MinLevelLogger (current_logger (), Logging. Error);
201201
@@ -221,7 +221,7 @@ and should return a new modified named tuple.
221221A simple example of its use is truncating messages.
222222
223223``` julia
224- julia> using Logging, LoggingExtras
224+ julia> using LoggingExtras
225225
226226julia> truncating_logger = TransformerLogger (global_logger ()) do log
227227 if length (log. message) > 128
@@ -262,7 +262,7 @@ We are going to log info and above to one file,
262262and warnings and above to another.
263263
264264``` julia
265- julia> using Logging; using LoggingExtras;
265+ julia> using LoggingExtras;
266266
267267julia> demux_logger = TeeLogger (
268268 MinLevelLogger (FileLogger (" info.log" ), Logging. Info),
@@ -298,7 +298,7 @@ when the `DateFormat` would change the filename. Note that if you wish to have
298298escape them so they are not interpreted by the `DateFormat` code. Example:
299299
300300``` julia
301- julia> using Logging, LoggingExtras
301+ julia> using LoggingExtras
302302
303303julia> rotating_logger = DatetimeRotatingFileLogger (pwd (), raw " \a\c\c\e\s\s -YYYY-mm-dd-HH-MM-SS.\l\o\g " );
304304
@@ -326,7 +326,7 @@ The `FormatLogger` is a sink that formats the message and prints to a wrapped IO
326326Formatting is done by providing a function `f(io::IO, log_args::NamedTuple)`.
327327
328328``` julia
329- julia> using Logging, LoggingExtras
329+ julia> using LoggingExtras
330330
331331julia> logger = FormatLogger () do io, args
332332 println (io, args. _module, " | " , " [" , args. level, " ] " , args. message)
@@ -346,7 +346,6 @@ Main | [Warn] This is a warning, should take a look.
346346
347347``` julia
348348using LoggingExtras
349- using Logging
350349
351350function sensible_message_filter (log)
352351 length (log. message) < 1028
@@ -360,7 +359,6 @@ global_logger(ActiveFilteredLogger(sensible_message_filter, global_logger()))
360359
361360``` julia
362361using LoggingExtras
363- using Logging
364362using HTTP
365363
366364function not_HTTP_message_filter (log)
@@ -374,7 +372,6 @@ global_logger(EarlyFilteredLogger(not_HTTP_message_filter, global_logger()))
374372
375373``` julia
376374using LoggingExtras
377- using Logging
378375using HTTP
379376
380377transformer_logger (global_logger ()) do log
@@ -393,7 +390,7 @@ global_logger(transformer_logger)
393390## Add timestamp to all logging
394391
395392``` julia
396- using Logging, LoggingExtras, Dates
393+ using LoggingExtras, Dates
397394
398395const date_format = " yyyy-mm-dd HH:MM:SS"
399396
0 commit comments