-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Logging.jl
62 lines (55 loc) · 1.54 KB
/
Logging.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This file is a part of Julia. License is MIT: https://julialang.org/license
"""
Utilities for capturing, filtering and presenting streams of log events.
Normally you don't need to import `Logging` to create log events; for this
the standard logging macros such as `@info` are already exported by `Base`
and available by default.
"""
module Logging
# Import the CoreLogging implementation into Logging as new const bindings.
# Doing it this way (rather than with import) makes these symbols accessible to
# tab completion.
for sym in [
:LogLevel, :BelowMinLevel, :Debug, :Info, :Warn, :Error, :AboveMaxLevel,
:AbstractLogger,
:NullLogger,
:handle_message, :shouldlog, :min_enabled_level, :catch_exceptions,
Symbol("@debug"),
Symbol("@info"),
Symbol("@warn"),
Symbol("@error"),
Symbol("@logmsg"),
:with_logger,
:current_logger,
:global_logger,
:disable_logging,
:SimpleLogger]
@eval const $sym = Base.CoreLogging.$sym
end
export
AbstractLogger,
LogLevel,
NullLogger,
@debug,
@info,
@warn,
@error,
@logmsg,
with_logger,
current_logger,
global_logger,
disable_logging,
SimpleLogger,
ConsoleLogger
include("ConsoleLogger.jl")
# The following are also part of the public API, but not exported:
#
# 1. Log levels:
# BelowMinLevel, Debug, Info, Warn, Error, AboveMaxLevel,
#
# 2. AbstractLogger message related functions:
# handle_message, shouldlog, min_enabled_level, catch_exceptions,
function __init__()
global_logger(ConsoleLogger(stderr))
end
end