|
45 | 45 | import Base: notnothing
|
46 | 46 | const IteratorSize = Base.IteratorSize
|
47 | 47 | const IteratorEltype = Base.IteratorEltype
|
| 48 | +enable_debug(x::Bool) = x |
48 | 49 |
|
49 | 50 |
|
50 | 51 | include("compatmacro.jl")
|
|
70 | 71 | end
|
71 | 72 | end
|
72 | 73 |
|
73 |
| -@static if !isdefined(Base, Symbol("@info")) |
74 |
| - macro info(msg, args...) |
75 |
| - return :(info($(esc(msg)), prefix = "Info: ")) |
76 |
| - end |
77 |
| -end |
78 |
| -@static if !isdefined(Base, Symbol("@warn")) |
79 |
| - macro warn(msg, args...) |
80 |
| - return :(warn($(esc(msg)), prefix = "Warning: ")) |
81 |
| - end |
82 |
| -end |
83 |
| - |
84 |
| -const DEBUG = Ref(false) # debug printing off by default, as on 0.7 |
85 |
| -enable_debug(x::Bool) = DEBUG[] = x |
86 |
| -@static if !isdefined(Base, Symbol("@debug")) |
87 |
| - function debug(msg) |
88 |
| - DEBUG[] || return |
89 |
| - buf = Base.IOBuffer() |
90 |
| - iob = Base.redirect(IOContext(buf, STDERR), Base.log_info_to, :debug) |
91 |
| - print_with_color(:blue, iob, "Debug: "; bold = true) |
92 |
| - Base.println_with_color(:blue, iob, chomp(string(msg))) |
93 |
| - print(STDERR, String(take!(buf))) |
94 |
| - return |
95 |
| - end |
96 |
| - macro debug(msg, args...) |
97 |
| - return :(debug($(esc(msg)))) |
98 |
| - end |
99 |
| -end |
100 |
| -@static if !isdefined(Base, Symbol("@error")) |
101 |
| - function _error(msg) |
102 |
| - buf = Base.IOBuffer() |
103 |
| - iob = Base.redirect(IOContext(buf, STDERR), Base.log_error_to, :error) |
104 |
| - print_with_color(Base.error_color(), iob, "Error: "; bold = true) |
105 |
| - Base.println_with_color(Base.error_color(), iob, chomp(string(msg))) |
106 |
| - print(STDERR, String(take!(buf))) |
107 |
| - return |
108 |
| - end |
109 |
| - macro error(msg, args...) |
110 |
| - return :(_error($(esc(msg)))) |
111 |
| - end |
112 |
| -end |
113 |
| - |
114 | 74 | # 0.7.0-DEV.3415
|
115 | 75 | if !isdefined(Base, :findall)
|
116 | 76 | const findall = find
|
|
0 commit comments