Coder Social home page Coder Social logo

mlog's People

Contributors

answeror avatar dekimsey avatar xdmiodz avatar zschoche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mlog's Issues

variadic template usage with visual compiler

Hello again,

I've been happily using mlog in our mac builds (thanks!), but I recently switched to try to build on the windows side and have run into a bit of a conundrum due to the lack of support for C++11 variadic templates (only way to enable it is currently with a preview build of vc).

I only see one place where the technique is used, when constructing a mlog::thread_safe<file_logger>. I've hacked my way around it for the moment (makes the thread safe file logger inaccessible), but I was wondering if you would consider a technique that would allow this code to work on the range of microsoft compilers.

cheers,
Rich

__FILE__ / __FUNCTION__ / __LINE__ support in metadata

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

Logging during application shutdown

I noticed that with the current way that mlogger is managed by a unique_ptr, it can lead to crashes when trying to log in destructors that stem for static data, since that mlogger might already have been destroyed.

I was wondering what your opinions are on having it leak until the application is destroyed. I've made this modification locally and it allows me to log in some really deep parts of my project, but of course it will show up on a leak tool like valgrind. I've always been of the opinion that this is one exception to the rule, anyway. Here's the commit if your interested.

Automatic choice of new logfile when size is too large

There's a bug at line 76 in mlog/file_logger.hpp. m_stream.open() will only succeed if the stream is already closed. Opening an already open stream will always fail. So I suggest to add m_stream.close(); between line 75 and 76.

Plans for multiple loggers?

I used mlog throughout my last project for logging to the mac console, std cout, Window's OutputDebugString and mlog's built-in file logger. I found it to be very nice experience, however one aspect that I was looking for was to be able to log to both file and console / cout / etc. at the same time.

Are there any plans for multiple loggers, or is there a recommended solution with the current design?

Thanks,
Rich

Based on boost

You forgot to mention that this library based on boost and boost is not lightweight! Correct me if I'm wrong!?

thx

mlog.sln broken

It looks like there is a missing reference to Test.vcxproj in mlog.sln, I was hoping to use this to run the tests as you would. Is there any chance it just isn't committed on your end?

Best,
Rich

License

The project lacks a license, could you please add one? See github's help for options.

Thanks.

cough MIT License is your friend cough

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.