mirror of
https://github.com/KjellKod/g3log.git
synced 2025-01-19 00:46:03 +01:00
1 line
53 KiB
JSON
1 line
53 KiB
JSON
|
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Introduction to G3log","text":"<p>introduction | detailed information | Configure & Build | API description | Custom log formatting</p>"},{"location":"#welcome-to-g3log","title":"Welcome to g3log","text":"<p>G3log is an asynchronous logger with three main features: 1. Intuitive <code>LOG(...)</code> API 2. <code>Design-by-contract</code> <code>CHECK(...)</code> functionality 3. Fatal crash handling for graceful shutdown of the logged process without loosing any log details up to the point of the crash</p> <p>The super quick introduction to g3log can be seen in the steps 1 - 9 below. </p> <p>For more in-depth information please see the full usage description in g3log_usage.md. The internal API for more advanced integration with g3log can be accessed in API.md</p>"},{"location":"#1-easy-usage-in-files","title":"1. Easy usage in files","text":"<p>Avoid deep dependency injection complexity and instead get access to the logger as easy as </p> <pre><code>#include <g3log/g3log.hpp>\n</code></pre>"},{"location":"#2-access-to-streaming-and-print_f-log-call-syntax","title":"2. Access to streaming and print_f log call syntax","text":"<p>Both streaming syntax <code>LOG</code> and print_f <code>LOGF</code> syntax are available. </p> <pre><code>LOGF(INFO, \"Hi log %d\", 123);\nLOG(INF) << \"Hi log \" << 123;\n\n</code></pre>"},{"location":"#3-conditional-logging","title":"3. Conditional logging","text":"<pre><code>LOG_IF(INFO, (1 < 2)) << \"If true this message will be logged\";\nLOGF_IF(INFO, (1 < 2), \"If true, then this %s will be logged\", \"message\");\n</code></pre>"},{"location":"#4-design-by-contract-framework","title":"4. Design-by-contract framework","text":"<pre><code>CHECK(less != more); // not fatal\nCHECK_F(less > more, \"CHECK(false) will trigger a fatal message\")\n</code></pre>"},{"location":"#5-handling-of-fatal","title":"5. Handling of fatal","text":"<p>By default g3log will capture fatal events such as <code>LOG(FATAL)</code>, <code>CHECK(false)</code> and otherwise fatal signals such as: </p> <pre><code> SIGABRT\n SIGFPE\n SIGILL\n SIGSEGV\n SIGTERM\n</code></pre> <p>When a fatal event happens the not-yet written log activity will be flushed to the logging sinks. Only when all logging activity up to the point of the fatal event has happend, will g3log allow the fatal event to proceed and exit the process. </p> <p>If <code>object</code> symbols are available the fatal handler will attempt to push the stacktrace up to the fatal reason to the logging sink. </p>"},{"location":"#5b-overriding-and-customization-of-fatal-event-handling","title":"5b. Overriding and customization of fatal event handling","text":"<p>For overriding fatal error handling to use your own, or to add code <code>hooks</code> that you want to execute please see the API.md doc. </p>"},{"location":"#6-default-and-custom-logging-levels","title":"6. Default and Custom logging levels","text":"<p>The default logging levels are <code>DEBUG</code>, <code>INFO</code>, <code>WARNING</code> and <code>FATAL</code>. You can define your own logging levels or completely replace the logging levels. Ref: API.md</p>"},{"location":"#7-log-filtering","title":"7. Log filtering","text":"<p>Log filtering is handled in g3log if dynamic logging levels are enabled in the configuration. See the API.md for information. Log filtering can also be handled through the sink as can be seen in github/Kjellod/g3sinks</p>"},{"location":"#8-3rd-party-and-custom-logging-sinks","title":"8. 3rd party and custom logging sinks","text":"<p>The default logging sink has no external 3rd party dependencies. For more logging sinks please see github/Kjellod/g3sinks</p> <ul> <li>log rotate</li> <li>log to syslog</li> <li>log to colored terminal output</li> <li>log rotate with filter</li> </ul> <p>See the API.md for more information about the simple steps to creating your own logging sink.</p>"},{"location":"#9-log-instantiation","title
|