@@ -1229,6 +1229,50 @@ end
12291229 end
12301230end
12311231
1232+ @static if ! isdefined (Base, Symbol (" @info" ))
1233+ macro info (msg, args... )
1234+ return :(info ($ (esc (msg)), prefix = " Info: " ))
1235+ end
1236+ else
1237+ @eval const $ (Symbol (" @info" )) = Base.$ (Symbol (" @info" ))
1238+ end
1239+ @static if ! isdefined (Base, Symbol (" @warn" ))
1240+ macro warn (msg, args... )
1241+ return :(warn ($ (esc (msg)), prefix = " Warning: " ))
1242+ end
1243+ else
1244+ @eval const $ (Symbol (" @warn" )) = Base.$ (Symbol (" @warn" ))
1245+ end
1246+ @static if ! isdefined (Base, Symbol (" @debug" ))
1247+ function debug (msg)
1248+ buf = IOBuffer ()
1249+ iob = Base. redirect (IOContext (buf, STDERR), Base. log_info_to, :debug )
1250+ print_with_color (:blue , iob, " Debug: " ; bold = true )
1251+ Base. println_with_color (:blue , iob, chomp (string (msg)))
1252+ print (STDERR, String (take! (buf)))
1253+ return
1254+ end
1255+ macro debug (msg, args... )
1256+ return :(debug ($ (esc (msg))))
1257+ end
1258+ else
1259+ @eval const $ (Symbol (" @debug" )) = Base.$ (Symbol (" @debug" ))
1260+ end
1261+ @static if ! isdefined (Base, Symbol (" @error" ))
1262+ function error (msg)
1263+ buf = IOBuffer ()
1264+ iob = Base. redirect (IOContext (buf, STDERR), Base. log_info_to, :error )
1265+ print_with_color (Base. error_color (), iob, " Error: " ; bold = true )
1266+ Base. println_with_color (Base. error_color (), iob, chomp (string (msg)))
1267+ print (STDERR, String (take! (buf)))
1268+ return
1269+ end
1270+ macro error (msg, args... )
1271+ return :(error ($ (esc (msg))))
1272+ end
1273+ else
1274+ @eval const $ (Symbol (" @error" )) = Base.$ (Symbol (" @error" ))
1275+ end
12321276
12331277include (" deprecated.jl" )
12341278
0 commit comments