Mike Innes just helped us come up with a neat little hack, that let me capture the file and line # info in a macro (it really *shouldn't* require a hack though, something needs to be done to fix #9577).
_lin(a::Expr) = a.args[2].args[1].args[1] _fil(a::Expr) = string(a.args[2].args[1].args[2]) _err(a::Expr) = a.args[2].args[2] macro warn(a) quote log(Warning, $(esc(:Symbol))($(_fil(a))), $(_lin(a)), $(_err(a))) end end and it is called with this way: const ERR_STATUS_CODE = 42 ... @warn(()->ERR_STATUS_CODE) The anonymous function is never even created, it's just parsed, and has the file/line info added, and then the macro code grabs the information placed there. On Tuesday, May 10, 2016 at 6:16:20 AM UTC-4, FANG Colin wrote: > > I am debugging some code. > > I would like to insert some markup function/macro in my code, so that I > know my code at least works fine until certain line number .... >