GlowupVibes.jl
GlowupVibes.jl copied to clipboard
The sus macro is sus
The @sus macro says that GlowupVibes is sussing. However, the REPL is the one sussing...
julia> @sus "The red one is sus"
┌ Warning: The red one is sus
└ @ Main ~/.julia/packages/GlowupVibes/Rkk2K/src/GlowupVibes.jl:25
julia> @warn "The red one is sus"
┌ Warning: The red one is sus
└ @ Main REPL[9]:1
This is as far as I've gotten so far.
using Base.CoreLogging: logmsg_code, LogLevel, _min_enabled_level, current_logger_for_env, shouldlog, handle_message, @_sourceinfo, logging_error
using Base.CoreLogging: Debug, Info, Warn, Error
macro sus(exs...)
logmsg_code((@_sourceinfo)..., :Warn, exs...)
end
julia> using GlowupVibes
julia> x = 5
5
julia> @sus "Hello world" x
┌ Warning: Hello world
│ x = 5
└ @ Main REPL[7]:1
My earlier attempt was to build a macrocall expression but this has problems displaying x as above.
macro sus(exs...)
Expr(:macrocall, Symbol("@warn"), __source__, exs...)
end
Can you elaborate some more on what is sus? Is it that it doesn't quote the correct line of source code in the log message?
Facts. The REPL[8] is sus not GlowupVibes.jl:25.