-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@__LINE__ (c.f @__FILE__) #8066
Comments
@chtlp Its Would be great if you could use the julia-user mailing list for these sort of questions. Thanks! |
Maling list link: https://groups.google.com/forum/#!forum/julia-users |
Thanks! I will ask in the group in the future. Is there a macro for the line number as well? |
Unfortunately, |
I'm working through FactCheck.jl and it has the following code to get the line:
I thought I'd throw this in here in case someone needs a dirty hack in the mean time... |
Bump. In JuMP we do tons of code generation, and without this macro it's very hard to give useful backtraces and error messages. |
Another possible hack:
|
that hack assumes macro-expansion is occurring during parsing, which it often doesn't |
@vtjnash doesn't |
no, since but also, yes, since |
Hi, I want to get the file and line number (in the same spirit to
__file__
and__file__
macro in C) for logging so I can quickly determine where the message was logged.show_backtrace()
has this information, but is there a way of getting the fields without parsing the string, so I can use this efficiently for logging?The text was updated successfully, but these errors were encountered: