Questions tagged [g2log]

G2log is an asynchronous, "crash safe" logger and design-by-contract library.

G2log is an asynchronous, "crash safe" logger and design-by-contract library. What this means in practice is that

  1. All the slow I/O disk access is done in a background thread. This ensures that the other parts of the software can immediately continue with their work after making a log entry.

  2. g2log provides logging, Design-by-Contract [#CHECK], and flush of log to file at shutdown. Buffered logs will be written to file before the application shuts down.

  3. It is thread safe, so using it from multiple threads is completely fine.

  4. It is CRAsH SAFE, in that it will catch certain fatal signals, so if your application crashes due to, say a segmentation fault, SIGSEGV, or some other fatal signals it will log and save to file this crash and all previously buffered log entries before exiting.

  5. It is cross platform. For now, tested on Windows7 and Ubuntu

  6. On Ubuntu a caught fatal signal will generate a stack dump to the log. This is not yet available on Windows due to the platforms complexity when traversing the stack. Stack dump on Windows will be released later and a beta is available on request.

  7. G2log is used in commercial products as well as hobby projects since early 2011. The code is given for free as public domain. This gives the option to change, use, and do whatever with it, no strings attached.

  8. The stable version of g2log is available at https://bitbucket.org/KjellKod/g2log The in-development g2log where new features are tried out is available at https://bitbucket.org/KjellKod/g2log-dev ongoing and released features can be
    seen at https://bitbucket.org/KjellKod/g2log-dev/wiki/Home

  9. The latest generation of "g2log", named g3log has all the features of g2log with the addition that custom made "log sinks" can be added. It can be seen at:
    https://bitbucket.org/KjellKod/g3log

3 questions
2
votes
2 answers

How can I add the console (stdout) as a sink in g3log?

I am new to g3log. I compiled and ran one of the examples I found in the repo, but was not able to ,modify it to print the log messages to the console rather than a file. The following lines from the example set the logger: auto worker =…
omer
  • 1,242
  • 4
  • 18
  • 45
2
votes
1 answer

Hiding implementation of G3Log

I am trying to use G3Log (a version of the Google logger - glog) to do some logging within a static library. All works very well until I try to bring that static library into a C++/CLI managed wrapper. When I do this, I get the dreaded …
user3072517
  • 513
  • 1
  • 7
  • 21
2
votes
2 answers

Initialize logger inside dll

I'm trying to use the g2log logging library inside my DLL project using VS2012. The problem is that looking at the documentation LINK」 it needs to be initialized at the beginning and stay alive for the lifespan of the program. Since I don't have a…
キキジキ
  • 1,443
  • 1
  • 25
  • 44