Skip to content
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

__FILE__ / __FUNCTION__ / __LINE__ support in metadata #2

Closed
ghost opened this issue Jul 19, 2013 · 5 comments
Closed

__FILE__ / __FUNCTION__ / __LINE__ support in metadata #2

ghost opened this issue Jul 19, 2013 · 5 comments

Comments

@ghost
Copy link

ghost commented Jul 19, 2013

Hey there and thanks for this library, agreed that boost::log is pretty heavy and I'm also looking for a lighter alternative.

I was wondering if you had any plans to support the standard defined preprocessor macros in the mlog::log_metadata struct, such as __FILE__, __FUNCTION__, __LINE__, etc. I find it much easier to look up in the source code where a problem is with these prepended to my log string, but they need to be captured at the macro level.

For now I'm just going to define my own macros and build the string there, but I think it would be a nice feature (and relatively cheap) to be able to control that behavior from the write_to_log virtual method.

cheers,
Rich

@zschoche
Copy link
Owner

yep you're right! I'll support this with the next update.

thanks!

@ghost
Copy link
Author

ghost commented Jul 29, 2013

Nice, looking forward to it, excellent work so far. cheers!

@zschoche
Copy link
Owner

Today, I've found a bit time to work on it.
I've added FILE and LINE. FUNCTION is not supported everywhere. Unfortunately.

Cheers!

@ghost
Copy link
Author

ghost commented Aug 13, 2013

Thanks alot, really appreciated.

Concerning the function string, I use __PRETTY_FUNCTION__ with clang and __FUNCTION__ with vc++. Dunno about gcc, but I bet it supports one or the other. What compiler are you finding has missing support for one of these?

@ibaun
Copy link

ibaun commented Jan 28, 2015

I believe this has gone in regression. With the current version of mlog, FILE and LINE are called in te templated write_message, which is called only in mlog.hpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants