Skip to content

Commit 148493d

Browse files
authored
Undo explicit extra bindings hack in Logging (#57891)
We now have `public` to indicate public symbols, which addresses the original reason this hack was introduced. Semantically reverts #32473.
1 parent 8fd3fb1 commit 148493d

File tree

1 file changed

+28
-71
lines changed

1 file changed

+28
-71
lines changed

stdlib/Logging/src/Logging.jl

Lines changed: 28 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -8,70 +8,33 @@ and available by default.
88
"""
99
module Logging
1010

11-
# Import the CoreLogging implementation into Logging as new const bindings.
12-
# Doing it this way (rather than with import) makes these symbols accessible to
13-
# tab completion.
14-
for sym in [
15-
:LogLevel,
16-
:AbstractLogger,
17-
:NullLogger,
18-
:handle_message, :shouldlog, :min_enabled_level, :catch_exceptions,
19-
Symbol("@debug"),
20-
Symbol("@info"),
21-
Symbol("@warn"),
22-
Symbol("@error"),
23-
Symbol("@logmsg"),
24-
:with_logger,
25-
:current_logger,
26-
:global_logger,
27-
:disable_logging,
28-
:SimpleLogger]
29-
@eval const $sym = Base.CoreLogging.$sym
30-
end
31-
32-
# LogLevel aliases (re-)documented here (JuliaLang/julia#40978)
33-
"""
34-
Debug
35-
36-
Alias for [`LogLevel(-1000)`](@ref LogLevel).
37-
"""
38-
const Debug = Base.CoreLogging.Debug
39-
"""
40-
Info
41-
42-
Alias for [`LogLevel(0)`](@ref LogLevel).
43-
"""
44-
const Info = Base.CoreLogging.Info
45-
"""
46-
Warn
47-
48-
Alias for [`LogLevel(1000)`](@ref LogLevel).
49-
"""
50-
const Warn = Base.CoreLogging.Warn
51-
"""
52-
Error
53-
54-
Alias for [`LogLevel(2000)`](@ref LogLevel).
55-
"""
56-
const Error = Base.CoreLogging.Error
57-
"""
58-
BelowMinLevel
59-
60-
Alias for [`LogLevel(-1_000_001)`](@ref LogLevel).
61-
"""
62-
const BelowMinLevel = Base.CoreLogging.BelowMinLevel
63-
"""
64-
AboveMaxLevel
65-
66-
Alias for [`LogLevel(1_000_001)`](@ref LogLevel).
67-
"""
68-
const AboveMaxLevel = Base.CoreLogging.AboveMaxLevel
69-
70-
using Base.CoreLogging:
71-
closed_stream, ConsoleLogger, default_metafmt
72-
73-
# Some packages use `Logging.default_logcolor`
74-
const default_logcolor = Base.CoreLogging.default_logcolor
11+
import Base.CoreLogging:
12+
LogLevel,
13+
AbstractLogger,
14+
NullLogger,
15+
handle_message, shouldlog, min_enabled_level, catch_exceptions,
16+
var"@debug",
17+
var"@info",
18+
var"@warn",
19+
var"@error",
20+
var"@logmsg",
21+
with_logger,
22+
current_logger,
23+
global_logger,
24+
disable_logging,
25+
SimpleLogger,
26+
Debug,
27+
Info,
28+
Warn,
29+
Error,
30+
BelowMinLevel,
31+
AboveMaxLevel,
32+
default_logcolor,
33+
closed_stream,
34+
ConsoleLogger,
35+
default_metafmt,
36+
# Some packages use `Logging.default_logcolor`
37+
default_logcolor
7538

7639
export
7740
AbstractLogger,
@@ -95,12 +58,6 @@ export
9558
Error,
9659
AboveMaxLevel
9760

98-
# The following are also part of the public API, but not exported:
99-
#
100-
# 1. Log levels:
101-
# BelowMinLevel, Debug, Info, Warn, Error, AboveMaxLevel,
102-
#
103-
# 2. AbstractLogger message related functions:
104-
# handle_message, shouldlog, min_enabled_level, catch_exceptions,
61+
public handle_message, shouldlog, min_enabled_level, catch_exceptions
10562

10663
end

0 commit comments

Comments
 (0)