{"id":32135317,"url":"https://github.com/kjellkod/g3log","last_synced_at":"2025-10-21T03:59:09.688Z","repository":{"id":21699766,"uuid":"25021151","full_name":"KjellKod/g3log","owner":"KjellKod","description":"G3log is  an asynchronous, \"crash safe\", logger that is easy to use with default logging sinks or you can add your own.  G3log is made with plain C++14 (C++11 support up to release 1.3.2)  with no external libraries (except gtest used for unit tests). G3log is made to be cross-platform, currently running on OSX, Windows and several Linux distros.  See Readme below for details of usage.","archived":false,"fork":false,"pushed_at":"2025-06-10T15:57:43.000Z","size":5165,"stargazers_count":934,"open_issues_count":1,"forks_count":279,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-10-08T11:55:29.605Z","etag":null,"topics":["async","asynchronous","c-plus-plus","crash-reporting","crash-safe","logger","logging","public-domain"],"latest_commit_sha":null,"homepage":"http://github.com/KjellKod/g3log","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KjellKod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-10-10T05:06:00.000Z","updated_at":"2025-09-26T13:27:07.000Z","dependencies_parsed_at":"2023-02-18T16:15:49.374Z","dependency_job_id":"3fe4b844-e04d-4102-9127-0307d2586295","html_url":"https://github.com/KjellKod/g3log","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/KjellKod/g3log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KjellKod%2Fg3log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KjellKod%2Fg3log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KjellKod%2Fg3log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KjellKod%2Fg3log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KjellKod","download_url":"https://codeload.github.com/KjellKod/g3log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KjellKod%2Fg3log/sbom","scorecard":{"id":79264,"data":{"date":"2025-08-11","repo":{"name":"github.com/KjellKod/g3log","commit":"38dbddc7071666ef6cc02f24ff30a8773ee4222f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.7,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":3,"reason":"2 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/buildAndRunTests.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/ctest.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/documentation.yml:10","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: The Unlicense: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/buildAndRunTests.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/KjellKod/g3log/buildAndRunTests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/KjellKod/g3log/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/KjellKod/g3log/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/KjellKod/g3log/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/KjellKod/g3log/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ctest.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/KjellKod/g3log/ctest.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/documentation.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/KjellKod/g3log/documentation.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/documentation.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/KjellKod/g3log/documentation.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/documentation.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/KjellKod/g3log/documentation.yml/master?enable=pin","Warn: containerImage not pinned by hash: .devcontainer/Dockerfile:2: pin your Docker image by updating mcr.microsoft.com/devcontainers/cpp:debian to mcr.microsoft.com/devcontainers/cpp:debian@sha256:715865d5500d48d954eaa194d897d10e82272a9440cb09f7605b5da974994a3c","Warn: pipCommand not pinned by hash: .github/workflows/documentation.yml:31","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":8,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 8 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T05:27:35.690Z","repository_id":21699766,"created_at":"2025-08-15T05:27:35.695Z","updated_at":"2025-08-15T05:27:35.695Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280200870,"owners_count":26289477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","asynchronous","c-plus-plus","crash-reporting","crash-safe","logger","logging","public-domain"],"created_at":"2025-10-21T03:59:07.645Z","updated_at":"2025-10-21T03:59:09.683Z","avatar_url":"https://github.com/KjellKod.png","language":"C++","funding_links":["https://www.paypal.me/g3log/25"],"categories":[],"sub_categories":[],"readme":"**Scanning Update**: [![ci/action CodeQL](https://github.com/KjellKod/g3log/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/KjellKod/g3log/actions/workflows/codeql-analysis.yml)\n\n\n# Contents \n[**introduction**](docs/index.md) | [detailed information](docs/g3log_usage.md) | [Configure \u0026 Build](docs/building.md) | [API description](docs/API.md) | [Custom log formatting](docs/API_custom_formatting.md)\n\n\n# Welcome to g3log\n### Use [kjellkod.github.io/g3log/](https://kjellkod.github.io/g3log/) for best reading / searching / navigating of g3log's documentation\n\nG3log is an asynchronous logger with three main features: \n1. Intuitive `LOG(...)` API\n2. `Design-by-contract` `CHECK(...)` functionality\n3. Fatal crash handling for graceful shutdown of the logged process without loosing any log details up to the point of the crash.\n\nThe super quick introduction to g3log can be seen in the steps 1 - 9 below. \n\nFor more in-depth information please see the full usage description in [g3log_usage.md](docs/g3log_usage.md). If you want to understand better the internals of g3log, then plase look at the [API.md](docs/API.md) for both high-level and deep-dive insights. \n\n\n## Experiment and try-out g3log in Github Codespaces \nref: [codespaces.md](docs/codespaces.md)\n\n\n## 1. Easy usage in files\nAvoid deep dependency injection complexity and instead get access to the logger as easy as:\n```\n#include \u003cg3log/g3log.hpp\u003e\n``` \n\n\n## 2. Access to streaming and print_f log call syntax\nBoth streaming syntax `LOG` and print_f `LOGF` syntax are available:\n\n```\nLOGF(INFO, \"Hi log %d\", 123);\nLOG(INF) \u003c\u003c \"Hi log \" \u003c\u003c 123;\n\n```\n\n## 3. Conditional logging\n\n```\nLOG_IF(INFO, (1 \u003c 2)) \u003c\u003c \"If true this message will be logged\";\nLOGF_IF(INFO, (1 \u003c 2), \"If true, then this %s will be logged\", \"message\");\n```\n\n## 4. Design-by-contract framework \n```\nCHECK(less != more); // not fatal\nCHECK_F(less \u003e more, \"CHECK(false) will trigger a fatal message\")\n```\n\n## 5. Handling of fatal \nBy default g3log will capture fatal events such as `LOG(FATAL)`, `CHECK(false)` and otherwise fatal signals such as: \n```\n    SIGABRT\n    SIGFPE\n    SIGILL\n    SIGSEGV\n    SIGTERM\n``` \n\nWhen 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. \n\nIf `object` symbols are available the fatal handler will attempt to push the stacktrace up to the fatal reason to the logging sink. \n\n#### 5b. Overriding and customization of fatal event handling\nFor overriding fatal error handling to use your own, or to add code `hooks` that you want to execute please see the [API.md](docs/API.md) doc. \n\n## 6. Default and Custom logging levels\nThe default logging levels are `DEBUG`, `INFO`, `WARNING` and `FATAL`. You can define your own logging levels or completely replace the logging levels. Ref: [API.md](docs/API.md)\n\n\n### 7. Log filtering\nLog filtering is handled in g3log if dynamic logging levels are enabled\nin the configuration. See the [API.md](docs/API.md) for information. Log filtering can also be handled through the sink as can be seen in [github/Kjellod/g3sinks](https://github.com/KjellKod/g3sinks)\n\n\n## 8. 3rd party and custom logging sinks\nThe default logging sink has no external 3rd party dependencies. For more logging sinks please see [github/Kjellod/g3sinks](https://github.com/KjellKod/g3sinks)\n\n- log rotate\n- log to syslog\n- log to colored terminal output\n- log rotate with filter\n\nSee the [API.md](docs/API.md) for more information about the simple steps to creating your own logging sink.\n\n\n## 9. Log instantiation \nWith the default application name left as is (i.e. \"g3log\") a creation of the logger could look something like this: \n\n```cpp\n  const std::string directory = \"./\";\n  const std::string name = \"TestLogFile\";\n  auto worker = g3::LogWorker::createLogWorker();\n  auto handle = worker-\u003eaddDefaultLogger(name, directory);\n```\nThe resulting filename would be something like: \n```\n   ./TestLogFile.g3log.20160217-001406.log\n```\n\n## \u003ca name=\"performance\"\u003ePerformance\u003c/a\u003e\nG3log aims to keep all background logging to sinks with as little log overhead as possible to the logging sink and with as small \"worst case latency\" as possible. For this reason g3log is a good logger for many systems that deal with critical tasks. Depending on platform the average logging overhead will differ. On my 2010 laptop the average call, when doing extreme performance testing, will be about ~2 us.\n\nThe worst case latency is kept stable with no extreme peaks, in spite of any sudden extreme pressure.  I have a blog post regarding comparing worst case latency for g3log and other loggers which might be of interest.\nYou can find it here: https://kjellkod.wordpress.com/2015/06/30/the-worlds-fastest-logger-vs-g3log/\n\n\n## \u003ca name=\"continuous_integration\"\u003eContinuous Integration\u003c/a\u003e\nThe g3log repository is evaluating github actions for executing test coverage, installation and document generation. In case you want to look into change any of these setups the following files are the ones of interest. \nSee `Actions` for matrix (ubuntu, macos, windows) testing as well as other actions for doc publishing. \n\n\n## \u003ca name=\"feedback\"\u003eFeedback\u003c/a\u003e\nIf you like this logger (or not) it would be nice with some feedback. That way I can improve g3log and it is always nice to hear when and how someone is using it. \n\n If you have ANY questions or problems please do not hesitate in contacting me at \n `Hedstrom @ Kjellod. cc`\n\n# \u003ca name=\"say-thanks\"\u003eSay Thanks\u003c/a\u003e\nThis logger is available for free and all of its source code is public domain.  A great way of saying thanks is to send a donation. It would go a long way not only to show your support but also to boost continued development.\n\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/g3log/25)\n\n* $5 for a cup of coffee\n* $25 for a late evening coding with takeout \n\n\nCheers\n\nKjell *(a.k.a. KjellKod)*\n\n[**introduction**](docs/index.md) | [detailed information](docs/g3log_usage.md) | [Configure \u0026 Build](docs/building.md) | [API description](docs/API.md) | [Custom log formatting](docs/API_custom_formatting.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjellkod%2Fg3log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkjellkod%2Fg3log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjellkod%2Fg3log/lists"}