Skip to content

Commit 6b79cac

Browse files
committed
reorganize all the files
include common.jl file include new file locations
1 parent 60dee60 commit 6b79cac

File tree

11 files changed

+30
-28
lines changed

11 files changed

+30
-28
lines changed
File renamed without changes.

src/CompositionalLoggers/common.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Utilities for dealing with compositional loggers.
2+
# Since the logging system itself will not engage its checks
3+
# Once the first logger has started, any compositional logger needs to check
4+
# before passing anything on.
5+
6+
# For checking child logger, need to check both `min_enabled_level` and `shouldlog`
7+
function comp_shouldlog(logger, args...)
8+
level = first(args)
9+
min_enabled_level(logger) <= level && shouldlog(logger, args...)
10+
end
11+
12+
# For checking if child logger will take the message you are sending
13+
function comp_handle_message_check(logger, args...; kwargs...)
14+
level, message, _module, group, id, file, line = args
15+
return comp_shouldlog(logger, level, _module, group, id)
16+
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/LoggingExtras.jl

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,20 @@ export Logging, AbstractLogger, LogLevel, NullLogger,
2424
with_logger, current_logger, global_logger, disable_logging,
2525
SimpleLogger, ConsoleLogger
2626

27-
######
28-
# Utilities for dealing with compositional loggers.
29-
# Since the logging system itself will not engage its checks
30-
# Once the first logger has started, any compositional logger needs to check
31-
# before passing anything on.
32-
33-
# For checking child logger, need to check both `min_enabled_level` and `shouldlog`
34-
function comp_shouldlog(logger, args...)
35-
level = first(args)
36-
min_enabled_level(logger) <= level && shouldlog(logger, args...)
37-
end
38-
39-
# For checking if child logger will take the message you are sending
40-
function comp_handle_message_check(logger, args...; kwargs...)
41-
level, message, _module, group, id, file, line = args
42-
return comp_shouldlog(logger, level, _module, group, id)
43-
end
44-
###############################
45-
46-
include("tee.jl")
47-
include("transformer.jl")
48-
include("activefiltered.jl")
49-
include("earlyfiltered.jl")
50-
include("minlevelfiltered.jl")
51-
include("filelogger.jl")
52-
include("formatlogger.jl")
53-
include("datetime_rotation.jl")
54-
include("overridelogger.jl")
27+
28+
include("CompositionalLoggers/common.jl")
29+
include("CompositionalLoggers/activefiltered.jl")
30+
include("CompositionalLoggers/earlyfiltered.jl")
31+
include("CompositionalLoggers/minlevelfiltered.jl")
32+
include("CompositionalLoggers/overridelogger.jl")
33+
include("CompositionalLoggers/tee.jl")
34+
include("CompositionalLoggers/transformer.jl")
35+
36+
include("Sinks/formatlogger.jl")
37+
include("Sinks/filelogger.jl")
38+
include("Sinks/datetime_rotation.jl")
39+
40+
5541
include("verbosity.jl")
5642
include("deprecated.jl")
5743

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)