@@ -23,7 +23,6 @@ for sym in [
23
23
Symbol (" @warn" ),
24
24
Symbol (" @error" ),
25
25
Symbol (" @logmsg" ),
26
- :custom_log_levels ,
27
26
:with_logger ,
28
27
:current_logger ,
29
28
:global_logger ,
@@ -32,39 +31,6 @@ for sym in [
32
31
@eval const $ sym = Base. CoreLogging.$ sym
33
32
end
34
33
35
- """
36
- @create_log_macro(name::Symbol, level::Int, face::Union{Symbol, StyledStrings.Face})
37
-
38
- Creates a custom log macro like `@info`, `@warn` etc. with a given `name`,
39
- `level` to be displayed with `face`. The macro created is named with the
40
- lowercase form of `name` but the given form is used for the printing.
41
-
42
- ```julia-repl
43
- julia> @create_log_macro(:MyLog, 200, :magenta)
44
- @mylog (macro with 1 method)
45
-
46
- julia> @mylog "hello"
47
- [ MyLog: hello
48
- ```
49
- """
50
- macro create_log_macro (name, level, color)
51
- macro_name = Symbol (lowercase (string (name)))
52
- macro_string = QuoteNode (name)
53
- loglevel = LogLevel (level)
54
- if loglevel in (BelowMinLevel, Debug, Info, Warn, Error, AboveMaxLevel)
55
- throw (ArgumentError (" Cannot use the same log level as a built in log macro" ))
56
- end
57
- if haskey (custom_log_levels, loglevel)
58
- throw (ArgumentError (" Custom log macro already exists for given log level" ))
59
- end
60
- quote
61
- $ (custom_log_levels)[$ (esc (loglevel))] = ($ (macro_string), $ (esc (color)))
62
- macro $ (esc (macro_name))(exs... )
63
- $ (Base. CoreLogging. logmsg_code)(($ (Base. CoreLogging. @_sourceinfo )). .. , $ (esc (loglevel)), exs... )
64
- end
65
- end
66
- end
67
-
68
34
# LogLevel aliases (re-)documented here (JuliaLang/julia#40978)
69
35
"""
70
36
Debug
@@ -115,7 +81,6 @@ export
115
81
@warn ,
116
82
@error ,
117
83
@logmsg ,
118
- @create_log_macro ,
119
84
with_logger,
120
85
current_logger,
121
86
global_logger,
0 commit comments