{"id":20585706,"url":"https://github.com/chronoxor/cpplogging","last_synced_at":"2025-04-07T09:20:26.935Z","repository":{"id":44156515,"uuid":"69190308","full_name":"chronoxor/CppLogging","owner":"chronoxor","description":"Ultra fast and low latency C++ Logging library with flexible configuration and high throughput in multithreaded environment","archived":false,"fork":false,"pushed_at":"2024-03-09T04:03:31.000Z","size":10704,"stargazers_count":164,"open_issues_count":0,"forks_count":41,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-31T06:06:32.997Z","etag":null,"topics":["logging","logging-library","low-latency","performance","speed"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chronoxor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2016-09-25T20:59:53.000Z","updated_at":"2025-03-24T09:23:22.000Z","dependencies_parsed_at":"2023-02-18T17:31:13.129Z","dependency_job_id":"78f094ec-fd95-48c7-898b-be354ae2d0f8","html_url":"https://github.com/chronoxor/CppLogging","commit_stats":{"total_commits":1290,"total_committers":2,"mean_commits":645.0,"dds":0.007751937984496138,"last_synced_commit":"725b16e21e78e1f7421960b8fd8de1d0cc8b79dd"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoxor%2FCppLogging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoxor%2FCppLogging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoxor%2FCppLogging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoxor%2FCppLogging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chronoxor","download_url":"https://codeload.github.com/chronoxor/CppLogging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247622983,"owners_count":20968575,"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","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":["logging","logging-library","low-latency","performance","speed"],"created_at":"2024-11-16T07:09:09.784Z","updated_at":"2025-04-07T09:20:26.916Z","avatar_url":"https://github.com/chronoxor.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CppLogging\n\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![Release](https://img.shields.io/github/release/chronoxor/CppLogging.svg?sort=semver)](https://github.com/chronoxor/CppLogging/releases)\n\u003cbr/\u003e\n[![Linux (clang)](https://github.com/chronoxor/CppLogging/actions/workflows/build-linux-clang.yml/badge.svg)](https://github.com/chronoxor/CppLogging/actions/workflows/build-linux-clang.yml)\n[![Linux (gcc)](https://github.com/chronoxor/CppLogging/actions/workflows/build-linux-gcc.yml/badge.svg)](https://github.com/chronoxor/CppLogging/actions/workflows/build-linux-gcc.yml)\n[![MacOS](https://github.com/chronoxor/CppLogging/actions/workflows/build-macos.yml/badge.svg)](https://github.com/chronoxor/CppLogging/actions/workflows/build-macos.yml)\n\u003cbr/\u003e\n[![Windows (Cygwin)](https://github.com/chronoxor/CppLogging/actions/workflows/build-windows-cygwin.yml/badge.svg)](https://github.com/chronoxor/CppLogging/actions/workflows/build-windows-cygwin.yml)\n[![Windows (MSYS2)](https://github.com/chronoxor/CppLogging/actions/workflows/build-windows-msys2.yml/badge.svg)](https://github.com/chronoxor/CppLogging/actions/workflows/build-windows-msys2.yml)\n[![Windows (MinGW)](https://github.com/chronoxor/CppLogging/actions/workflows/build-windows-mingw.yml/badge.svg)](https://github.com/chronoxor/CppLogging/actions/workflows/build-windows-mingw.yml)\n[![Windows (Visual Studio)](https://github.com/chronoxor/CppLogging/actions/workflows/build-windows-vs.yml/badge.svg)](https://github.com/chronoxor/CppLogging/actions/workflows/build-windows-vs.yml)\n\nC++ Logging Library provides functionality to log different events with a high\nthroughput in multithreaded environment into different sinks (console, files,\nrolling files, syslog, etc.). Logging configuration is very flexible and gives\nfunctionality to build flexible logger hierarchy with combination of logging\nprocessors (sync, async), filters, layouts (binary, hash, text) and appenders.\n\n[CppLogging API reference](https://chronoxor.github.io/CppLogging/index.html)\n\n# Contents\n  * [Features](#features)\n  * [Requirements](#requirements)\n  * [How to build?](#how-to-build)\n  * [Logging examples](#logging-examples)\n    * [Example 1: Default logger](#example-1-default-logger)\n    * [Example 2: Format with logger](#example-2-format-with-logger)\n    * [Example 3: Configure custom logger with text layout and console appender](#example-3-configure-custom-logger-with-text-layout-and-console-appender)\n    * [Example 4: Configure custom logger with text layout and syslog appender](#example-4-configure-custom-logger-with-text-layout-and-syslog-appender)\n    * [Example 5: Configure custom logger with binary layout and file appender](#example-5-configure-custom-logger-with-binary-layout-and-file-appender)\n    * [Example 6: Configure custom logger with hash layout and file appender](#example-6-configure-custom-logger-with-hash-layout-and-file-appender)\n    * [Example 7: Configure logger with custom text layout pattern](#example-7-configure-logger-with-custom-text-layout-pattern)\n    * [Example 8: Configure rolling file appender with time-based policy](#example-8-configure-rolling-file-appender-with-time-based-policy)\n    * [Example 9: Configure rolling file appender with size-based policy](#example-9-configure-rolling-file-appender-with-size-based-policy)\n    * [Example 10: Multithreaded logging with synchronous processor](#example-10-multithreaded-logging-with-synchronous-processor)\n    * [Example 11: Multithreaded logging with asynchronous processor](#example-11-multithreaded-logging-with-asynchronous-processor)\n  * [Logging benchmarks](#logging-benchmarks)\n    * [Benchmark 1: Null appender](#benchmark-1-null-appender)\n    * [Benchmark 2: File appender](#benchmark-2-file-appender)\n    * [Benchmark 3: Synchronous processor with null appender](#benchmark-3-synchronous-processor-with-null-appender)\n    * [Benchmark 4: Asynchronous processor with null appender](#benchmark-4-asynchronous-processor-with-null-appender)\n    * [Benchmark 5: Synchronous processor with file appender](#benchmark-5-synchronous-processor-with-file-appender)\n    * [Benchmark 6: Asynchronous processor with file appender](#benchmark-6-asynchronous-processor-with-file-appender)\n    * [Benchmark 7: Format in logging thread vs binary serialization without format](#benchmark-7-format-in-logging-thread-vs-binary-serialization-without-format)\n    * [Benchmark 8: Binary layout vs hash layout vs text layout](#benchmark-8-binary-layout-vs-hash-layout-vs-text-layout)\n    * [Benchmark 9: Format vs store format](#benchmark-9-format-vs-store-format)\n  * [Tools](#tools)\n    * [Binary log reader](#binary-log-reader)\n    * [Hash log reader](#hash-log-reader)\n    * [Hash log builder](#hash-log-builder)\n\n# Features\n* Cross platform (Linux, MacOS, Windows)\n* Optimized for performance\n* Binary, hash \u0026 text layouts\n* Synchronous logging\n* Asynchronous logging\n* Flexible configuration and logger processing hierarchy\n* Appenders collection (null, memory, console, file, rolling file, ostream, syslog)\n* Logging levels (debug, info, warning, error, fatal)\n* Logging filters (by level, by logger name, by message pattern)\n* Format logging records using [{fmt} library](http://fmtlib.net)\n* Hash layout using [32-bit FNV-1a string hashing](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash)\n* Log files rolling policies (time-based, size-bases)\n* Log files Zip archivation\n\n# Requirements\n* Linux\n* MacOS\n* Windows\n* [cmake](https://www.cmake.org)\n* [gcc](https://gcc.gnu.org)\n* [git](https://git-scm.com)\n* [gil](https://github.com/chronoxor/gil.git)\n* [python3](https://www.python.org)\n\nOptional:\n* [clang](https://clang.llvm.org)\n* [CLion](https://www.jetbrains.com/clion)\n* [Cygwin](https://cygwin.com)\n* [MSYS2](https://www.msys2.org)\n* [MinGW](https://mingw-w64.org/doku.php)\n* [Visual Studio](https://www.visualstudio.com)\n\n# How to build?\n\n### Linux: install required packages\n```shell\nsudo apt-get install -y binutils-dev uuid-dev\n```\n\n### Install [gil (git links) tool](https://github.com/chronoxor/gil)\n```shell\npip3 install gil\n```\n\n### Setup repository\n```shell\ngit clone https://github.com/chronoxor/CppLogging.git\ncd CppLogging\ngil update\n```\n\n### Linux\n```shell\ncd build\n./unix.sh\n```\n\n### MacOS\n```shell\ncd build\n./unix.sh\n```\n\n### Windows (Cygwin)\n```shell\ncd build\nunix.bat\n```\n\n### Windows (MSYS2)\n```shell\ncd build\nunix.bat\n```\n\n### Windows (MinGW)\n```shell\ncd build\nmingw.bat\n```\n\n### Windows (Visual Studio)\n```shell\ncd build\nvs.bat\n```\n\n# Logging examples\n\n## Example 1: Default logger\nThis is the simple example of using default logger. Just link it with\nCppLogging library and you'll get default logger functionality with\ntext layout and console appender:\n\n```c++\n#include \"logging/logger.h\"\n\nint main(int argc, char** argv)\n{\n    // Create default logger\n    CppLogging::Logger logger;\n\n    // Log some messages with different level\n    logger.Debug(\"Debug message\");\n    logger.Info(\"Info message\");\n    logger.Warn(\"Warning message\");\n    logger.Error(\"Error message\");\n    logger.Fatal(\"Fatal message\");\n\n    return 0;\n}\n```\n\nExample will create the following log in console:\n![Default report](https://github.com/chronoxor/CppLogging/raw/master/images/default.png)\n\n## Example 2: Format with logger\nCppLogging library provides powerful logging format API based on the\n[{fmt} library](http://fmtlib.net):\n\n```c++\n#include \"logging/logger.h\"\n\nclass Date\n{\npublic:\n    Date(int year, int month, int day) : _year(year), _month(month), _day(day) {}\n\n    friend std::ostream\u0026 operator\u003c\u003c(std::ostream\u0026 os, const Date\u0026 date)\n    { return os \u003c\u003c date._year \u003c\u003c '-' \u003c\u003c date._month \u003c\u003c '-' \u003c\u003c date._day; }\n\n    friend CppLogging::Record\u0026 operator\u003c\u003c(CppLogging::Record\u0026 record, const Date\u0026 date)\n    { return record.StoreCustomFormat(\"{}-{}-{}\", date._year, date._month, date._day); }\n\nprivate:\n    int _year, _month, _day;\n};\n\nclass DateTime\n{\npublic:\n    DateTime(Date date, int hours, int minutes, int seconds) : _date(date), _hours(hours), _minutes(minutes), _seconds(seconds) {}\n\n    friend std::ostream\u0026 operator\u003c\u003c(std::ostream\u0026 os, const DateTime\u0026 datetime)\n    { return os \u003c\u003c datetime._date \u003c\u003c \" \" \u003c\u003c datetime._hours \u003c\u003c ':' \u003c\u003c datetime._minutes \u003c\u003c ':' \u003c\u003c datetime._seconds; }\n\n    friend CppLogging::Record\u0026 operator\u003c\u003c(CppLogging::Record\u0026 record, const DateTime\u0026 datetime)\n    {\n        const size_t begin = record.StoreListBegin();\n        record.StoreList(datetime._date);\n        record.StoreList(' ');\n        record.StoreList(datetime._hours);\n        record.StoreList(':');\n        record.StoreList(datetime._minutes);\n        record.StoreList(':');\n        record.StoreList(datetime._seconds);\n        return record.StoreListEnd(begin);\n    }\n\nprivate:\n    Date _date;\n    int _hours, _minutes, _seconds;\n};\n\nint main(int argc, char** argv)\n{\n    // Create default logger\n    CppLogging::Logger logger;\n\n    // Log some messages with format\n    logger.Info(\"argc: {}, argv: {}\", argc, (void*)argv);\n    logger.Info(\"no arguments\");\n    logger.Info(\"{0}, {1}, {2}\", -1, 0, 1);\n    logger.Info(\"{0}, {1}, {2}\", 'a', 'b', 'c');\n    logger.Info(\"{}, {}, {}\", 'a', 'b', 'c');\n    logger.Info(\"{2}, {1}, {0}\", 'a', 'b', 'c');\n    logger.Info(\"{0}{1}{0}\", \"abra\", \"cad\");\n    logger.Info(\"{:\u003c30}\", \"left aligned\");\n    logger.Info(\"{:\u003e30}\", \"right aligned\");\n    logger.Info(\"{:^30}\", \"centered\");\n    logger.Info(\"{:*^30}\", \"centered\");\n    logger.Info(\"{:+f}; {:+f}\", 3.14, -3.14);\n    logger.Info(\"{: f}; {: f}\", 3.14, -3.14);\n    logger.Info(\"{:-f}; {:-f}\", 3.14, -3.14);\n    logger.Info(\"int: {0:d};  hex: {0:x};  oct: {0:o}; bin: {0:b}\", 42);\n    logger.Info(\"int: {0:d};  hex: {0:#x};  oct: {0:#o};  bin: {0:#b}\", 42);\n    logger.Info(\"The date is {}\", Date(2012, 12, 9));\n    logger.Info(\"The datetime is {}\", DateTime(Date(2012, 12, 9), 13, 15, 57));\n    logger.Info(\"Elapsed time: {s:.2f} seconds\", \"s\"_a = 1.23);\n    logger.Info(\"The answer is {}\"_format(42));\n\n    return 0;\n}\n```\n\nExample will create the following log:\n```\n2019-03-27T12:04:19.881Z [0x0000FFB8] INFO   - argc: 1, argv: 0x1ff83563210\n2019-03-27T12:04:19.882Z [0x0000FFB8] INFO   - no arguments\n2019-03-27T12:04:19.883Z [0x0000FFB8] INFO   - -1, 0, 1\n2019-03-27T12:04:19.884Z [0x0000FFB8] INFO   - a, b, c\n2019-03-27T12:04:19.884Z [0x0000FFB8] INFO   - a, b, c\n2019-03-27T12:04:19.884Z [0x0000FFB8] INFO   - c, b, a\n2019-03-27T12:04:19.884Z [0x0000FFB8] INFO   - abracadabra\n2019-03-27T12:04:19.885Z [0x0000FFB8] INFO   - left aligned\n2019-03-27T12:04:19.885Z [0x0000FFB8] INFO   -                  right aligned\n2019-03-27T12:04:19.885Z [0x0000FFB8] INFO   -            centered\n2019-03-27T12:04:19.886Z [0x0000FFB8] INFO   - ***********centered***********\n2019-03-27T12:04:19.886Z [0x0000FFB8] INFO   - +3.140000; -3.140000\n2019-03-27T12:04:19.887Z [0x0000FFB8] INFO   -  3.140000; -3.140000\n2019-03-27T12:04:19.887Z [0x0000FFB8] INFO   - 3.140000; -3.140000\n2019-03-27T12:04:19.887Z [0x0000FFB8] INFO   - int: 42;  hex: 2a;  oct: 52; bin: 101010\n2019-03-27T12:04:19.888Z [0x0000FFB8] INFO   - int: 42;  hex: 0x2a;  oct: 052;  bin: 0b101010\n2019-03-27T12:04:19.888Z [0x0000FFB8] INFO   - The date is 2012-12-9\n2019-03-27T12:04:19.888Z [0x0000FFB8] INFO   - The datetime is 2012-12-9 13:15:57\n2019-03-27T12:04:19.889Z [0x0000FFB8] INFO   - Elapsed time: 1.23 seconds\n2019-03-27T12:04:19.889Z [0x0000FFB8] INFO   - The answer is 42\n```\n\n## Example 3: Configure custom logger with text layout and console appender\nThis example shows how to configure a custom logger with a given name to\nperform logging with a text layout and console appender sink:\n\n```c++\n#include \"logging/config.h\"\n#include \"logging/logger.h\"\n\nvoid ConfigureLogger()\n{\n    // Create default logging sink processor with a text layout\n    auto sink = std::make_shared\u003cCppLogging::Processor\u003e(std::make_shared\u003cCppLogging::TextLayout\u003e());\n    // Add console appender\n    sink-\u003eappenders().push_back(std::make_shared\u003cCppLogging::ConsoleAppender\u003e());\n\n    // Configure example logger\n    CppLogging::Config::ConfigLogger(\"example\", sink);\n}\n\nint main(int argc, char** argv)\n{\n    // Configure logger\n    ConfigureLogger();\n\n    // Create example logger\n    CppLogging::Logger logger(\"example\");\n\n    // Log some messages with different level\n    logger.Debug(\"Debug message\");\n    logger.Info(\"Info message\");\n    logger.Warn(\"Warning message\");\n    logger.Error(\"Error message\");\n    logger.Fatal(\"Fatal message\");\n\n    return 0;\n}\n```\n\n## Example 4: Configure custom logger with text layout and syslog appender\n*Syslog appender is available only in Unix platforms and does nothing in\nWindows!*\n\nThis example shows how to configure a custom logger with a given name to\nperform logging with a text layout and syslog appender sink:\n\n```c++\n#include \"logging/config.h\"\n#include \"logging/logger.h\"\n\nvoid ConfigureLogger()\n{\n    // Create default logging sink processor with a text layout\n    auto sink = std::make_shared\u003cCppLogging::Processor\u003e(std::make_shared\u003cCppLogging::TextLayout\u003e());\n    // Add syslog appender\n    sink-\u003eappenders().push_back(std::make_shared\u003cCppLogging::SyslogAppender\u003e());\n\n    // Configure example logger\n    CppLogging::Config::ConfigLogger(\"example\", sink);\n}\n\nint main(int argc, char** argv)\n{\n    // Configure logger\n    ConfigureLogger();\n\n    // Create example logger\n    CppLogging::Logger logger(\"example\");\n\n    // Log some messages with different level\n    logger.Debug(\"Debug message\");\n    logger.Info(\"Info message\");\n    logger.Warn(\"Warning message\");\n    logger.Error(\"Error message\");\n    logger.Fatal(\"Fatal message\");\n\n    return 0;\n}\n```\n\n## Example 5: Configure custom logger with binary layout and file appender\nThis example shows how to configure a custom logger with a given name to\nperform logging with a binary layout and file appender sink:\n\n```c++\n#include \"logging/config.h\"\n#include \"logging/logger.h\"\n\nvoid ConfigureLogger()\n{\n    // Create default logging sink processor with a binary layout\n    auto sink = std::make_shared\u003cCppLogging::Processor\u003e(std::make_shared\u003cCppLogging::BinaryLayout\u003e());\n    // Add file appender\n    sink-\u003eappenders().push_back(std::make_shared\u003cCppLogging::FileAppender\u003e(\"file.bin.log\"));\n\n    // Configure example logger\n    CppLogging::Config::ConfigLogger(\"example\", sink);\n}\n\nint main(int argc, char** argv)\n{\n    // Configure logger\n    ConfigureLogger();\n\n    // Create example logger\n    CppLogging::Logger logger(\"example\");\n\n    // Log some messages with different level\n    logger.Debug(\"Debug message {}\", 1);\n    logger.Info(\"Info message {}\", 2);\n    logger.Warn(\"Warning message {}\", 3);\n    logger.Error(\"Error message {}\", 4);\n    logger.Fatal(\"Fatal message {}\", 5);\n\n    return 0;\n}\n```\n\n## Example 6: Configure custom logger with hash layout and file appender\nThis example shows how to configure a custom logger with a given name to\nperform logging with a hash layout and file appender sink:\n\n```c++\n#include \"logging/config.h\"\n#include \"logging/logger.h\"\n\nvoid ConfigureLogger()\n{\n    // Create default logging sink processor with a hash layout\n    auto sink = std::make_shared\u003cCppLogging::Processor\u003e(std::make_shared\u003cCppLogging::HashLayout\u003e());\n    // Add file appender\n    sink-\u003eappenders().push_back(std::make_shared\u003cCppLogging::FileAppender\u003e(\"file.hash.log\"));\n\n    // Configure example logger\n    CppLogging::Config::ConfigLogger(\"example\", sink);\n\n    // Startup the logging infrastructure\n    CppLogging::Config::Startup();\n}\n\nint main(int argc, char** argv)\n{\n    // Configure logger\n    ConfigureLogger();\n\n    // Create example logger\n    CppLogging::Logger logger(\"example\");\n\n    // Log some messages with different level\n    logger.Debug(\"Debug message {}\", 1);\n    logger.Info(\"Info message {}\", 2);\n    logger.Warn(\"Warning message {}\", 3);\n    logger.Error(\"Error message {}\", 4);\n    logger.Fatal(\"Fatal message {}\", 5);\n\n    return 0;\n}\n```\n\n## Example 7: Configure logger with custom text layout pattern\nText layout message is flexible to customize with layout pattern. Text layout\npattern is a string with a special placeholders provided inside curly brackets\n(\"{}\").\n\nSupported placeholders:\n- **{UtcDateTime} / {LocalDateTime}** - converted to the UTC/local date \u0026 time (e.g. \"1997-07-16T19:20:30.123Z\" / \"1997-07-16T19:20:30.123+01:00\")\n- **{UtcDate} / {LocalDate}** - converted to the UTC/local date (e.g. \"1997-07-16\")\n- **{Time} / {LocalTime}** - converted to the UTC/local time (e.g. \"19:20:30.123Z\" / \"19:20:30.123+01:00\")\n- **{UtcYear} / {LocalYear}** - converted to the UTC/local four-digits year (e.g. \"1997\")\n- **{UtcMonth} / {LocalMonth}** - converted to the UTC/local two-digits month (e.g. \"07\")\n- **{UtcDay} / {LocalDay}** - converted to the UTC/local two-digits day (e.g. \"16\")\n- **{UtcHour} / {LocalHour}** - converted to the UTC/local two-digits hour (e.g. \"19\")\n- **{UtcMinute} / {LocalMinute}** - converted to the UTC/local two-digits minute (e.g. \"20\")\n- **{UtcSecond} / {LocalSecond}** - converted to the UTC/local two-digits second (e.g. \"30\")\n- **{UtcTimezone} / {LocalTimezone}** - converted to the UTC/local timezone suffix (e.g. \"Z\" / \"+01:00\")\n- **{Millisecond}** - converted to the three-digits millisecond (e.g. \"123\")\n- **{Microsecond}** - converted to the three-digits microsecond (e.g. \"123\")\n- **{Nanosecond}** - converted to the three-digits nanosecond (e.g. \"789\")\n- **{Thread}** - converted to the thread Id (e.g. \"0x0028F3D8\")\n- **{Level}** - converted to the logging level\n- **{Logger}** - converted to the logger name\n- **{Message}** - converted to the log message\n- **{EndLine}** - converted to the end line suffix (e.g. Unix \"\\n\" or Windows \"\\r\\n\")\n\n```c++\n#include \"logging/config.h\"\n#include \"logging/logger.h\"\n\nvoid ConfigureLogger()\n{\n    // Create a custom text layout pattern\n    const std::string pattern = \"{UtcYear}-{UtcMonth}-{UtcDay}T{UtcHour}:{UtcMinute}:{UtcSecond}.{Millisecond}{UtcTimezone} - {Microsecond}.{Nanosecond} - [{Thread}] - {Level} - {Logger} - {Message} - {EndLine}\";\n\n    // Create default logging sink processor with a text layout\n    auto sink = std::make_shared\u003cCppLogging::Processor\u003e(std::make_shared\u003cCppLogging::TextLayout\u003e(pattern));\n    // Add console appender\n    sink-\u003eappenders().push_back(std::make_shared\u003cCppLogging::ConsoleAppender\u003e());\n\n    // Configure example logger\n    CppLogging::Config::ConfigLogger(\"example\", sink);\n}\n\nint main(int argc, char** argv)\n{\n    // Configure logger\n    ConfigureLogger();\n\n    // Create example logger\n    CppLogging::Logger logger(\"example\");\n\n    // Log some messages with different level\n    logger.Debug(\"Debug message\");\n    logger.Info(\"Info message\");\n    logger.Warn(\"Warning message\");\n    logger.Error(\"Error message\");\n    logger.Fatal(\"Fatal message\");\n\n    return 0;\n}\n```\n\n## Example 8: Configure rolling file appender with time-based policy\nTime-based rolling policy will create a new logging file to write into using\na special pattern (contains date \u0026 time placeholders).\n\nTime-based policy composes logging filename from the given pattern using the\nfollowing placeholders:\n- **{UtcDateTime} / {LocalDateTime}** - converted to the UTC/local date \u0026 time (e.g. \"1997-07-16T192030Z\" / \"1997-07-16T192030+0100\")\n- **{UtcDate} / {LocalDate}** - converted to the UTC/local date (e.g. \"1997-07-16\")\n- **{Time} / {LocalTime}** - converted to the UTC/local time (e.g. \"192030Z\" / \"192030+0100\")\n- **{UtcYear} / {LocalYear}** - converted to the UTC/local four-digits year (e.g. \"1997\")\n- **{UtcMonth} / {LocalMonth}** - converted to the UTC/local two-digits month (e.g. \"07\")\n- **{UtcDay} / {LocalDay}** - converted to the UTC/local two-digits day (e.g. \"16\")\n- **{UtcHour} / {LocalHour}** - converted to the UTC/local two-digits hour (e.g. \"19\")\n- **{UtcMinute} / {LocalMinute}** - converted to the UTC/local two-digits minute (e.g. \"20\")\n- **{UtcSecond} / {LocalSecond}** - converted to the UTC/local two-digits second (e.g. \"30\")\n- **{UtcTimezone} / {LocalTimezone}** - converted to the UTC/local timezone suffix (e.g. \"Z\" / \"+0100\")\n\n```c++\n#include \"logging/config.h\"\n#include \"logging/logger.h\"\n\nvoid ConfigureLogger()\n{\n    // Create default logging sink processor with a text layout\n    auto sink = std::make_shared\u003cCppLogging::Processor\u003e(std::make_shared\u003cCppLogging::TextLayout\u003e());\n    // Add rolling file appender which rolls each second and create log file with a pattern \"{UtcDateTime}.log\"\n    sink-\u003eappenders().push_back(std::make_shared\u003cCppLogging::RollingFileAppender\u003e(\".\", CppLogging::TimeRollingPolicy::SECOND, \"{UtcDateTime}.log\", true));\n\n    // Configure example logger\n    CppLogging::Config::ConfigLogger(\"example\", sink);\n}\n\nint main(int argc, char** argv)\n{\n    // Configure logger\n    ConfigureLogger();\n\n    // Create example logger\n    CppLogging::Logger logger(\"example\");\n\n    // Log some messages with different level\n    logger.Debug(\"Debug message\");\n    logger.Info(\"Info message\");\n    logger.Warn(\"Warning message\");\n    logger.Error(\"Error message\");\n    logger.Fatal(\"Fatal message\");\n\n    return 0;\n}\n```\n\n## Example 9: Configure rolling file appender with size-based policy\nSize-based rolling policy will create a new logging file to write when the\ncurrent file size exceeded size limit. Logging backups are indexed and its\ncount could be limited as well.\n\nSize-based policy for 5 backups works in a following way:\n```\nexample.log   -\u003e example.1.log\nexample.1.log -\u003e example.2.log\nexample.2.log -\u003e example.3.log\nexample.3.log -\u003e example.4.log\nexample.4.log -\u003e example.5.log\nexample.5.log -\u003e remove\n```\n\n```c++\n#include \"logging/config.h\"\n#include \"logging/logger.h\"\n\nvoid ConfigureLogger()\n{\n    // Create default logging sink processor with a binary layout\n    auto sink = std::make_shared\u003cCppLogging::Processor\u003e(std::make_shared\u003cCppLogging::BinaryLayout\u003e());\n    // Add rolling file appender which rolls after append 4kb of logs and will keep only 5 recent archives\n    sink-\u003eappenders().push_back(std::make_shared\u003cCppLogging::RollingFileAppender\u003e(\".\", \"file\", \"bin.log\", 4096, 5, true));\n\n    // Configure example logger\n    CppLogging::Config::ConfigLogger(\"example\", sink);\n}\n\nint main(int argc, char** argv)\n{\n    // Configure logger\n    ConfigureLogger();\n\n    // Create example logger\n    CppLogging::Logger logger(\"example\");\n\n    // Log some messages with different level\n    logger.Debug(\"Debug message\");\n    logger.Info(\"Info message\");\n    logger.Warn(\"Warning message\");\n    logger.Error(\"Error message\");\n    logger.Fatal(\"Fatal message\");\n\n    return 0;\n}\n```\n\n## Example 10: Multithreaded logging with synchronous processor\nSynchronous processor uses critical-section lock to avoid multiple\nthreads from logging at the same time (logging threads are waiting\nuntil critical-section is released).\n\nThis example shows how to configure a custom logger with a given name to\nuse synchronous processor in multithreaded environment:\n\n```c++\n#include \"logging/config.h\"\n#include \"logging/logger.h\"\n\n#include \u003catomic\u003e\n#include \u003ciostream\u003e\n#include \u003cthread\u003e\n#include \u003cvector\u003e\n\nvoid ConfigureLogger()\n{\n    // Create default logging sink processor with a binary layout\n    auto sink = std::make_shared\u003cCppLogging::SyncProcessor\u003e(std::make_shared\u003cCppLogging::BinaryLayout\u003e());\n    // Add file appender with size-based rolling policy and archivation\n    sink-\u003eappenders().push_back(std::make_shared\u003cCppLogging::RollingFileAppender\u003e(\".\", \"rolling\", \"bin.log\", 4096, 9, true));\n\n    // Configure example logger\n    CppLogging::Config::ConfigLogger(\"example\", sink);\n}\n\nint main(int argc, char** argv)\n{\n    // Configure logger\n    ConfigureLogger();\n\n    std::cout \u003c\u003c \"Press Enter to stop...\" \u003c\u003c std::endl;\n\n    int concurrency = 4;\n\n    // Start some threads\n    std::atomic\u003cbool\u003e stop(false);\n    std::vector\u003cstd::thread\u003e threads;\n    for (int thread = 0; thread \u003c concurrency; ++thread)\n    {\n        threads.push_back(std::thread([\u0026stop]()\n        {\n            // Create example logger\n            CppLogging::Logger logger(\"example\");\n\n            int index = 0;\n\n            while (!stop)\n            {\n                ++index;\n\n                // Log some messages with different level\n                logger.Debug(\"Debug message {}\", index);\n                logger.Info(\"Info message {}\", index);\n                logger.Warn(\"Warning message {}\", index);\n                logger.Error(\"Error message {}\", index);\n                logger.Fatal(\"Fatal message {}\", index);\n\n                // Yield for a while...\n                CppCommon::Thread::Yield();\n            }\n        }));\n    }\n\n    // Wait for input\n    std::cin.get();\n\n    // Stop threads\n    stop = true;\n\n    // Wait for all threads\n    for (auto\u0026 thread : threads)\n        thread.join();\n\n    return 0;\n}\n```\n\n## Example 11: Multithreaded logging with asynchronous processor\nAsynchronous processor uses lock-free queue to collect logging records from\nmultiple threads at the same time.\n\nThis example shows much better performance with less threads contentions in\ncomparison with the previous one for lots of threads:\n\n```c++\n#include \"logging/config.h\"\n#include \"logging/logger.h\"\n\n#include \u003catomic\u003e\n#include \u003ciostream\u003e\n#include \u003cthread\u003e\n#include \u003cvector\u003e\n\nvoid ConfigureLogger()\n{\n    // Create default logging sink processor with a text layout\n    auto sink = std::make_shared\u003cCppLogging::AsyncWaitProcessor\u003e(std::make_shared\u003cCppLogging::TextLayout\u003e());\n    // Add file appender with time-based rolling policy and archivation\n    sink-\u003eappenders().push_back(std::make_shared\u003cCppLogging::RollingFileAppender\u003e(\".\", CppLogging::TimeRollingPolicy::SECOND, \"{UtcDateTime}.log\", true));\n\n    // Configure example logger\n    CppLogging::Config::ConfigLogger(\"example\", sink);\n}\n\nint main(int argc, char** argv)\n{\n    // Configure logger\n    ConfigureLogger();\n\n    std::cout \u003c\u003c \"Press Enter to stop...\" \u003c\u003c std::endl;\n\n    int concurrency = 4;\n\n    // Start some threads\n    std::atomic\u003cbool\u003e stop(false);\n    std::vector\u003cstd::thread\u003e threads;\n    for (int thread = 0; thread \u003c concurrency; ++thread)\n    {\n        threads.push_back(std::thread([\u0026stop]()\n        {\n            // Create example logger\n            CppLogging::Logger logger(\"example\");\n\n            while (!stop)\n            {\n                // Log some messages with different level\n                logger.Debug(\"Debug message\");\n                logger.Info(\"Info message\");\n                logger.Warn(\"Warning message\");\n                logger.Error(\"Error message\");\n                logger.Fatal(\"Fatal message\");\n\n                // Yield for a while...\n                CppCommon::Thread::Yield();\n            }\n        }));\n    }\n\n    // Wait for input\n    std::cin.get();\n\n    // Stop threads\n    stop = true;\n\n    // Wait for all threads\n    for (auto\u0026 thread : threads)\n        thread.join();\n\n    return 0;\n}\n```\n\n# Logging benchmarks\n\n## Benchmark 1: Null appender\nBenchmark source file: [appender_null.cpp](https://github.com/chronoxor/CppLogging/blob/master/performance/appender_null.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppLogging report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 16.910 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Wed Mar 27 21:20:19 2019\nUTC timestamp: Wed Mar 27 18:20:19 2019\n===============================================================================\nBenchmark: NullAppender-binary\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: NullAppender-binary\nAverage time: 52 ns/op\nMinimal time: 52 ns/op\nMaximal time: 55 ns/op\nTotal time: 2.848 s\nTotal operations: 54324965\nOperations throughput: 19070173 ops/s\n===============================================================================\nBenchmark: NullAppender-text\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: NullAppender-text\nAverage time: 214 ns/op\nMinimal time: 214 ns/op\nMaximal time: 225 ns/op\nTotal time: 4.325 s\nTotal operations: 20163398\nOperations throughput: 4661367 ops/s\n===============================================================================\n```\n\n## Benchmark 2: File appender\nBenchmark source file: [appender_file.cpp](https://github.com/chronoxor/CppLogging/blob/master/performance/appender_file.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 15.824 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Wed Mar 27 21:21:36 2019\nUTC timestamp: Wed Mar 27 18:21:36 2019\n===============================================================================\nBenchmark: FileAppender-binary\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: FileAppender-binary\nAverage time: 99 ns/op\nMinimal time: 99 ns/op\nMaximal time: 114 ns/op\nTotal time: 3.490 s\nTotal operations: 34960790\nOperations throughput: 10015343 ops/s\n===============================================================================\nBenchmark: FileAppender-text\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: FileAppender-text\nAverage time: 285 ns/op\nMinimal time: 285 ns/op\nMaximal time: 306 ns/op\nTotal time: 4.266 s\nTotal operations: 14965162\nOperations throughput: 3507742 ops/s\n===============================================================================\n```\n\n## Benchmark 3: Synchronous processor with null appender\nBenchmark source file: [processor_sync.cpp](https://github.com/chronoxor/CppLogging/blob/master/performance/processor_sync.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 17.407 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Wed Mar 27 21:28:21 2019\nUTC timestamp: Wed Mar 27 18:28:21 2019\n===============================================================================\nBenchmark: SyncProcessor-null\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-null(threads:1)\nAverage time: 80 ns/op\nMinimal time: 80 ns/op\nMaximal time: 84 ns/op\nTotal time: 4.227 s\nTotal operations: 52444919\nOperations throughput: 12404934 ops/s\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-null(threads:2)\nAverage time: 51 ns/op\nMinimal time: 51 ns/op\nMaximal time: 53 ns/op\nTotal time: 4.865 s\nTotal operations: 93864920\nOperations throughput: 19291320 ops/s\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-null(threads:4)\nAverage time: 179 ns/op\nMinimal time: 179 ns/op\nMaximal time: 186 ns/op\nTotal time: 7.643 s\nTotal operations: 42621432\nOperations throughput: 5575895 ops/s\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-null(threads:8)\nAverage time: 228 ns/op\nMinimal time: 228 ns/op\nMaximal time: 231 ns/op\nTotal time: 6.480 s\nTotal operations: 28420296\nOperations throughput: 4385653 ops/s\n===============================================================================\nBenchmark: SyncProcessor-binary\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-binary(threads:1)\nAverage time: 89 ns/op\nMinimal time: 89 ns/op\nMaximal time: 92 ns/op\nTotal time: 4.602 s\nTotal operations: 51618553\nOperations throughput: 11215740 ops/s\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-binary(threads:2)\nAverage time: 100 ns/op\nMinimal time: 100 ns/op\nMaximal time: 104 ns/op\nTotal time: 8.152 s\nTotal operations: 81421390\nOperations throughput: 9986857 ops/s\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-binary(threads:4)\nAverage time: 217 ns/op\nMinimal time: 217 ns/op\nMaximal time: 221 ns/op\nTotal time: 6.998 s\nTotal operations: 32183128\nOperations throughput: 4598492 ops/s\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-binary(threads:8)\nAverage time: 278 ns/op\nMinimal time: 278 ns/op\nMaximal time: 281 ns/op\nTotal time: 6.371 s\nTotal operations: 22856032\nOperations throughput: 3587107 ops/s\n===============================================================================\nBenchmark: SyncProcessor-text\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-text(threads:1)\nAverage time: 283 ns/op\nMinimal time: 283 ns/op\nMaximal time: 303 ns/op\nTotal time: 5.107 s\nTotal operations: 18024389\nOperations throughput: 3529002 ops/s\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-text(threads:2)\nAverage time: 337 ns/op\nMinimal time: 337 ns/op\nMaximal time: 346 ns/op\nTotal time: 6.441 s\nTotal operations: 19102240\nOperations throughput: 2965400 ops/s\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-text(threads:4)\nAverage time: 451 ns/op\nMinimal time: 451 ns/op\nMaximal time: 472 ns/op\nTotal time: 5.836 s\nTotal operations: 12929948\nOperations throughput: 2215485 ops/s\n-------------------------------------------------------------------------------\nPhase: SyncProcessor-text(threads:8)\nAverage time: 635 ns/op\nMinimal time: 635 ns/op\nMaximal time: 647 ns/op\nTotal time: 5.781 s\nTotal operations: 9093400\nOperations throughput: 1572751 ops/s\n===============================================================================\n```\n\n## Benchmark 4: Asynchronous processor with null appender\nBenchmark source file: [processor_async.cpp](https://github.com/chronoxor/CppLogging/blob/master/performance/processor_async.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 17.461 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Wed Mar 27 21:43:05 2019\nUTC timestamp: Wed Mar 27 18:43:05 2019\n===============================================================================\nBenchmark: AsyncWaitProcessor-null\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-null(threads:1)\nAverage time: 136 ns/op\nMinimal time: 136 ns/op\nMaximal time: 140 ns/op\nTotal time: 5.524 s\nTotal operations: 40467636\nOperations throughput: 7324587 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-null(threads:2)\nAverage time: 91 ns/op\nMinimal time: 91 ns/op\nMaximal time: 93 ns/op\nTotal time: 5.776 s\nTotal operations: 63377688\nOperations throughput: 10972051 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-null(threads:4)\nAverage time: 62 ns/op\nMinimal time: 62 ns/op\nMaximal time: 62 ns/op\nTotal time: 6.249 s\nTotal operations: 100633072\nOperations throughput: 16101439 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-null(threads:8)\nAverage time: 120 ns/op\nMinimal time: 120 ns/op\nMaximal time: 138 ns/op\nTotal time: 7.087 s\nTotal operations: 58752032\nOperations throughput: 8289066 ops/s\n===============================================================================\nBenchmark: AsyncWaitFreeProcessor-null\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-null(threads:1)\nAverage time: 136 ns/op\nMinimal time: 136 ns/op\nMaximal time: 140 ns/op\nTotal time: 5.592 s\nTotal operations: 40978681\nOperations throughput: 7327131 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-null(threads:2)\nAverage time: 92 ns/op\nMinimal time: 92 ns/op\nMaximal time: 93 ns/op\nTotal time: 5.833 s\nTotal operations: 63027456\nOperations throughput: 10804833 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-null(threads:4)\nAverage time: 62 ns/op\nMinimal time: 62 ns/op\nMaximal time: 63 ns/op\nTotal time: 6.205 s\nTotal operations: 99585424\nOperations throughput: 16047167 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-null(threads:8)\nAverage time: 106 ns/op\nMinimal time: 106 ns/op\nMaximal time: 119 ns/op\nTotal time: 6.786 s\nTotal operations: 63909008\nOperations throughput: 9416668 ops/s\n===============================================================================\nBenchmark: AsyncWaitProcessor-binary\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-binary(threads:1)\nAverage time: 131 ns/op\nMinimal time: 131 ns/op\nMaximal time: 133 ns/op\nTotal time: 5.011 s\nTotal operations: 38131145\nOperations throughput: 7608534 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-binary(threads:2)\nAverage time: 87 ns/op\nMinimal time: 87 ns/op\nMaximal time: 89 ns/op\nTotal time: 5.212 s\nTotal operations: 59811130\nOperations throughput: 11474219 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-binary(threads:4)\nAverage time: 144 ns/op\nMinimal time: 144 ns/op\nMaximal time: 154 ns/op\nTotal time: 7.396 s\nTotal operations: 51026276\nOperations throughput: 6898920 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-binary(threads:8)\nAverage time: 144 ns/op\nMinimal time: 144 ns/op\nMaximal time: 147 ns/op\nTotal time: 6.523 s\nTotal operations: 45218480\nOperations throughput: 6931931 ops/s\n===============================================================================\nBenchmark: AsyncWaitFreeProcessor-binary\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-binary(threads:1)\nAverage time: 136 ns/op\nMinimal time: 136 ns/op\nMaximal time: 139 ns/op\nTotal time: 5.049 s\nTotal operations: 37042770\nOperations throughput: 7336301 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-binary(threads:2)\nAverage time: 86 ns/op\nMinimal time: 86 ns/op\nMaximal time: 90 ns/op\nTotal time: 5.143 s\nTotal operations: 59458290\nOperations throughput: 11560056 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-binary(threads:4)\nAverage time: 141 ns/op\nMinimal time: 141 ns/op\nMaximal time: 150 ns/op\nTotal time: 7.482 s\nTotal operations: 52698160\nOperations throughput: 7042986 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-binary(threads:8)\nAverage time: 142 ns/op\nMinimal time: 142 ns/op\nMaximal time: 150 ns/op\nTotal time: 6.616 s\nTotal operations: 46393216\nOperations throughput: 7012137 ops/s\n===============================================================================\nBenchmark: AsyncWaitProcessor-text\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-text(threads:1)\nAverage time: 354 ns/op\nMinimal time: 354 ns/op\nMaximal time: 379 ns/op\nTotal time: 6.846 s\nTotal operations: 19297269\nOperations throughput: 2818594 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-text(threads:2)\nAverage time: 408 ns/op\nMinimal time: 408 ns/op\nMaximal time: 438 ns/op\nTotal time: 6.199 s\nTotal operations: 15173816\nOperations throughput: 2447449 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-text(threads:4)\nAverage time: 473 ns/op\nMinimal time: 473 ns/op\nMaximal time: 483 ns/op\nTotal time: 6.151 s\nTotal operations: 12987696\nOperations throughput: 2111302 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitProcessor-text(threads:8)\nAverage time: 545 ns/op\nMinimal time: 545 ns/op\nMaximal time: 571 ns/op\nTotal time: 5.925 s\nTotal operations: 10872848\nOperations throughput: 1834828 ops/s\n===============================================================================\nBenchmark: AsyncWaitFreeProcessor-text\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-text(threads:1)\nAverage time: 364 ns/op\nMinimal time: 364 ns/op\nMaximal time: 401 ns/op\nTotal time: 6.467 s\nTotal operations: 17724308\nOperations throughput: 2740618 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-text(threads:2)\nAverage time: 401 ns/op\nMinimal time: 401 ns/op\nMaximal time: 433 ns/op\nTotal time: 6.078 s\nTotal operations: 15141962\nOperations throughput: 2491024 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-text(threads:4)\nAverage time: 449 ns/op\nMinimal time: 449 ns/op\nMaximal time: 543 ns/op\nTotal time: 5.538 s\nTotal operations: 12314328\nOperations throughput: 2223352 ops/s\n-------------------------------------------------------------------------------\nPhase: AsyncWaitFreeProcessor-text(threads:8)\nAverage time: 501 ns/op\nMinimal time: 501 ns/op\nMaximal time: 555 ns/op\nTotal time: 5.822 s\nTotal operations: 11619480\nOperations throughput: 1995719 ops/s\n===============================================================================\n```\n\n## Benchmark 5: Synchronous processor with file appender\nBenchmark source file: [file_sync.cpp](https://github.com/chronoxor/CppLogging/blob/master/performance/file_sync.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 17.227 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Wed Mar 27 23:13:37 2019\nUTC timestamp: Wed Mar 27 20:13:37 2019\n===============================================================================\nBenchmark: FileSync-binary\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: FileSync-binary(threads:1)\nAverage time: 227 ns/op\nMinimal time: 227 ns/op\nMaximal time: 241 ns/op\nTotal time: 7.525 s\nTotal operations: 33111269\nOperations throughput: 4399767 ops/s\n-------------------------------------------------------------------------------\nPhase: FileSync-binary(threads:2)\nAverage time: 319 ns/op\nMinimal time: 319 ns/op\nMaximal time: 342 ns/op\nTotal time: 8.822 s\nTotal operations: 27619980\nOperations throughput: 3130472 ops/s\n-------------------------------------------------------------------------------\nPhase: FileSync-binary(threads:4)\nAverage time: 384 ns/op\nMinimal time: 384 ns/op\nMaximal time: 400 ns/op\nTotal time: 7.569 s\nTotal operations: 19670920\nOperations throughput: 2598539 ops/s\n-------------------------------------------------------------------------------\nPhase: FileSync-binary(threads:8)\nAverage time: 512 ns/op\nMinimal time: 512 ns/op\nMaximal time: 521 ns/op\nTotal time: 7.187 s\nTotal operations: 14028248\nOperations throughput: 1951843 ops/s\n===============================================================================\nBenchmark: FileSync-text\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: FileSync-text(threads:1)\nAverage time: 510 ns/op\nMinimal time: 510 ns/op\nMaximal time: 547 ns/op\nTotal time: 7.051 s\nTotal operations: 13811530\nOperations throughput: 1958764 ops/s\n-------------------------------------------------------------------------------\nPhase: FileSync-text(threads:2)\nAverage time: 546 ns/op\nMinimal time: 546 ns/op\nMaximal time: 572 ns/op\nTotal time: 7.555 s\nTotal operations: 13836406\nOperations throughput: 1831251 ops/s\n-------------------------------------------------------------------------------\nPhase: FileSync-text(threads:4)\nAverage time: 682 ns/op\nMinimal time: 682 ns/op\nMaximal time: 716 ns/op\nTotal time: 7.188 s\nTotal operations: 10538168\nOperations throughput: 1466009 ops/s\n-------------------------------------------------------------------------------\nPhase: FileSync-text(threads:8)\nAverage time: 894 ns/op\nMinimal time: 894 ns/op\nMaximal time: 903 ns/op\nTotal time: 6.956 s\nTotal operations: 7776856\nOperations throughput: 1117940 ops/s\n===============================================================================\n```\n\n## Benchmark 6: Asynchronous processor with file appender\nBenchmark source file: [file_async.cpp](https://github.com/chronoxor/CppLogging/blob/master/performance/file_async.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 17.590 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Wed Mar 27 23:45:08 2019\nUTC timestamp: Wed Mar 27 20:45:08 2019\n===============================================================================\nBenchmark: FileAsyncWait-binary\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: FileAsyncWait-binary(threads:1)\nAverage time: 103 ns/op\nMinimal time: 103 ns/op\nMaximal time: 125 ns/op\nTotal time: 4.257 s\nTotal operations: 40989563\nOperations throughput: 9627463 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWait-binary(threads:2)\nAverage time: 126.513 mcs/op\nMinimal time: 126.513 mcs/op\nMaximal time: 140.340 mcs/op\nTotal time: 2.838 s\nTotal operations: 22438\nOperations throughput: 7904 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWait-binary(threads:4)\nAverage time: 310 ns/op\nMinimal time: 310 ns/op\nMaximal time: 329 ns/op\nTotal time: 7.908 s\nTotal operations: 25465332\nOperations throughput: 3219949 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWait-binary(threads:8)\nAverage time: 354 ns/op\nMinimal time: 354 ns/op\nMaximal time: 380 ns/op\nTotal time: 7.662 s\nTotal operations: 21622472\nOperations throughput: 2821727 ops/s\n===============================================================================\nBenchmark: FileAsyncWaitFree-binary\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: FileAsyncWaitFree-binary(threads:1)\nAverage time: 107 ns/op\nMinimal time: 107 ns/op\nMaximal time: 126 ns/op\nTotal time: 4.459 s\nTotal operations: 41402456\nOperations throughput: 9283109 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWaitFree-binary(threads:2)\nAverage time: 135.946 mcs/op\nMinimal time: 135.946 mcs/op\nMaximal time: 147.538 mcs/op\nTotal time: 2.964 s\nTotal operations: 21810\nOperations throughput: 7355 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWaitFree-binary(threads:4)\nAverage time: 331 ns/op\nMinimal time: 331 ns/op\nMaximal time: 344 ns/op\nTotal time: 7.963 s\nTotal operations: 24025796\nOperations throughput: 3016885 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWaitFree-binary(threads:8)\nAverage time: 346 ns/op\nMinimal time: 346 ns/op\nMaximal time: 370 ns/op\nTotal time: 7.713 s\nTotal operations: 22267464\nOperations throughput: 2886785 ops/s\n===============================================================================\nBenchmark: FileAsyncWait-text\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: FileAsyncWait-text(threads:1)\nAverage time: 373 ns/op\nMinimal time: 373 ns/op\nMaximal time: 445 ns/op\nTotal time: 4.837 s\nTotal operations: 12964360\nOperations throughput: 2679716 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWait-text(threads:2)\nAverage time: 614 ns/op\nMinimal time: 614 ns/op\nMaximal time: 1.399 mcs/op\nTotal time: 8.445 ms\nTotal operations: 13734\nOperations throughput: 1626248 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWait-text(threads:4)\nAverage time: 705 ns/op\nMinimal time: 705 ns/op\nMaximal time: 727 ns/op\nTotal time: 7.016 s\nTotal operations: 9950764\nOperations throughput: 1418200 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWait-text(threads:8)\nAverage time: 794 ns/op\nMinimal time: 794 ns/op\nMaximal time: 828 ns/op\nTotal time: 6.891 s\nTotal operations: 8670376\nOperations throughput: 1258208 ops/s\n===============================================================================\nBenchmark: FileAsyncWaitFree-text\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: FileAsyncWaitFree-text(threads:1)\nAverage time: 384 ns/op\nMinimal time: 384 ns/op\nMaximal time: 414 ns/op\nTotal time: 5.349 s\nTotal operations: 13925080\nOperations throughput: 2602936 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWaitFree-text(threads:2)\nAverage time: 727 ns/op\nMinimal time: 727 ns/op\nMaximal time: 1.065 mcs/op\nTotal time: 12.221 ms\nTotal operations: 16797\nOperations throughput: 1374399 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWaitFree-text(threads:4)\nAverage time: 765 ns/op\nMinimal time: 765 ns/op\nMaximal time: 875 ns/op\nTotal time: 6.467 s\nTotal operations: 8445064\nOperations throughput: 1305736 ops/s\n-------------------------------------------------------------------------------\nPhase: FileAsyncWaitFree-text(threads:8)\nAverage time: 777 ns/op\nMinimal time: 777 ns/op\nMaximal time: 824 ns/op\nTotal time: 6.834 s\nTotal operations: 8791624\nOperations throughput: 1286393 ops/s\n===============================================================================\n```\n\n## Benchmark 7: Format in logging thread vs binary serialization without format\nBenchmark source file: [async_format.cpp](https://github.com/chronoxor/CppLogging/blob/master/performance/async_format.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 17.790 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Wed Mar 27 23:54:02 2019\nUTC timestamp: Wed Mar 27 20:54:02 2019\n===============================================================================\nBenchmark: Format(int, double, string)\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: Format(int, double, string)(threads:1)\nAverage time: 432 ns/op\nMinimal time: 432 ns/op\nMaximal time: 451 ns/op\nTotal time: 4.508 s\nTotal operations: 10415618\nOperations throughput: 2310166 ops/s\n-------------------------------------------------------------------------------\nPhase: Format(int, double, string)(threads:2)\nAverage time: 371 ns/op\nMinimal time: 371 ns/op\nMaximal time: 509 ns/op\nTotal time: 7.954 ms\nTotal operations: 21389\nOperations throughput: 2688944 ops/s\n-------------------------------------------------------------------------------\nPhase: Format(int, double, string)(threads:4)\nAverage time: 321 ns/op\nMinimal time: 321 ns/op\nMaximal time: 340 ns/op\nTotal time: 8.972 s\nTotal operations: 27908800\nOperations throughput: 3110554 ops/s\n-------------------------------------------------------------------------------\nPhase: Format(int, double, string)(threads:8)\nAverage time: 391 ns/op\nMinimal time: 391 ns/op\nMaximal time: 431 ns/op\nTotal time: 8.539 s\nTotal operations: 21836936\nOperations throughput: 2557197 ops/s\n===============================================================================\nBenchmark: Serialize(int, double, string)\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: Serialize(int, double, string)(threads:1)\nAverage time: 137 ns/op\nMinimal time: 137 ns/op\nMaximal time: 159 ns/op\nTotal time: 4.004 s\nTotal operations: 29199876\nOperations throughput: 7291852 ops/s\n-------------------------------------------------------------------------------\nPhase: Serialize(int, double, string)(threads:2)\nAverage time: 173.561 mcs/op\nMinimal time: 173.561 mcs/op\nMaximal time: 193.575 mcs/op\nTotal time: 3.322 s\nTotal operations: 19142\nOperations throughput: 5761 ops/s\n-------------------------------------------------------------------------------\nPhase: Serialize(int, double, string)(threads:4)\nAverage time: 473 ns/op\nMinimal time: 473 ns/op\nMaximal time: 498 ns/op\nTotal time: 8.683 s\nTotal operations: 18328828\nOperations throughput: 2110848 ops/s\n-------------------------------------------------------------------------------\nPhase: Serialize(int, double, string)(threads:8)\nAverage time: 487 ns/op\nMinimal time: 487 ns/op\nMaximal time: 522 ns/op\nTotal time: 8.415 s\nTotal operations: 17251000\nOperations throughput: 2049912 ops/s\n===============================================================================\n```\n\n## Benchmark 8: Binary layout vs hash layout vs text layout\nBenchmark source file: [layout.cpp](https://github.com/chronoxor/CppLogging/blob/master/performance/layout.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.2.0\n===============================================================================\nCPU architecture: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 19.664 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuration: release\nLocal timestamp: Wed Dec 29 03:57:38 2021\nUTC timestamp: Wed Dec 29 00:57:38 2021\n===============================================================================\nBenchmark: BinaryLayout\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: BinaryLayout\nAverage time: 55 ns/op\nMinimal time: 65 ns/op\nMaximal time: 66 ns/op\nTotal time: 2.602 s\nTotal operations: 47082888\nTotal bytes: 3.834 GiB\nOperations throughput: 18088810 ops/s\nBytes throughput: 1.476 GiB/s\n===============================================================================\nBenchmark: HashLayout\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: HashLayout\nAverage time: 80 ns/op\nMinimal time: 96 ns/op\nMaximal time: 96 ns/op\nTotal time: 3.057 s\nTotal operations: 38025560\nTotal bytes: 2.127 GiB\nOperations throughput: 12435583 ops/s\nBytes throughput: 711.583 MiB/s\n===============================================================================\nBenchmark: TextLayout\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: TextLayout\nAverage time: 645 ns/op\nMinimal time: 774 ns/op\nMaximal time: 780 ns/op\nTotal time: 4.632 s\nTotal operations: 7171461\nTotal bytes: 640.004 MiB\nOperations throughput: 1548184 ops/s\nBytes throughput: 138.168 MiB/s\n===============================================================================\n```\n\n## Benchmark 9: Format vs store format\nBenchmark source file: [format.cpp](https://github.com/chronoxor/CppLogging/blob/master/performance/format.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 17.694 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Thu Mar 28 00:09:59 2019\nUTC timestamp: Wed Mar 27 21:09:59 2019\n===============================================================================\nBenchmark: Format(int)\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: Format(int)\nAverage time: 129 ns/op\nMinimal time: 129 ns/op\nMaximal time: 138 ns/op\nTotal time: 3.899 s\nTotal operations: 30121235\nOperations throughput: 7724549 ops/s\n===============================================================================\nBenchmark: StoreFormat(int)\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: StoreFormat(int)\nAverage time: 18 ns/op\nMinimal time: 18 ns/op\nMaximal time: 19 ns/op\nTotal time: 1.726 s\nTotal operations: 94928448\nOperations throughput: 54976298 ops/s\n===============================================================================\nBenchmark: Format(int, double, string)\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: Format(int, double, string)\nAverage time: 319 ns/op\nMinimal time: 319 ns/op\nMaximal time: 334 ns/op\nTotal time: 4.491 s\nTotal operations: 14047637\nOperations throughput: 3127578 ops/s\n===============================================================================\nBenchmark: StoreFormat(int, double, string)\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: StoreFormat(int, double, string)\nAverage time: 33 ns/op\nMinimal time: 33 ns/op\nMaximal time: 35 ns/op\nTotal time: 2.485 s\nTotal operations: 73499935\nOperations throughput: 29570995 ops/s\n===============================================================================\n```\n\n# Tools\n\n## Binary log reader\nBinary log reader is used to  convert  binary  logs  (*.bin.log,  *.bin.log.zip\nfiles) to the human-readable text format. By default  it  reads  binary  stream\nfrom 'stdin' and outputs converted text to 'stdout'. However it is possible  to\nprovide explicit input/output file names using command line arguments.\n\n```shell\nUsage: binlog [options]\n\nOptions:\n  --version             show program's version number and exit\n  -h, --help            show this help message and exit\n  -h HELP, --help=HELP  Show help\n  -i INPUT, --input=INPUT\n                        Input file name\n  -o OUTPUT, --output=OUTPUT\n                        Output file name\n```\n\n## Hash log reader\nHash log reader is used to convert hash logs (*.hash.log, *.hash.log.zip files)\nto the human-readable text format. By  default  it  reads  binary  stream  from\n'stdin' and outputs converted text to  'stdout'.  However  it  is  possible  to\nprovide explicit input/output file names using command line arguments.\n\n```shell\nUsage: hashlog [options]\n\nOptions:\n  --version             show program's version number and exit\n  -h, --help            show this help message and exit\n  -x HASHLOG, --hashlog=HASHLOG\n                        Hashlog file name\n  -i INPUT, --input=INPUT\n                        Input file name\n  -o OUTPUT, --output=OUTPUT\n                        Output file name\n  -u UPDATE, --update=UPDATE\n                        Update .hashlog\n```\n\nHash log depends on .hashlog map file. If hashlog file  name  is  not  provided\nexplicitly with '--hashlog' parameter the tool will search  for  .hashlog  file\nstarted from the current directory and go up to the parent directory hierarchy.\n\nIf .hashlog map file was not found or some hash code \u0026 string pair  is  missing\nthen text log will contain the hash code in the corresponding place.\n\nHash log reader could  be  used  to  update  .hashlog  file  from  binary  logs\n('*.bin.log', '*.bin.log.zip' files). In this case '--update' parameter  should\nbe used with binary logs. It will read all available strings,  calculate  their\nhash codes and update .hashlog with new hash code \u0026 string pairs.\n\n```shell\nhashlog.exe -x .hashlog -u file.bin.log\nDiscovered logging message: \"example\" with hash = 0x8BF23EA1\nDiscovered logging message: \"Info message {}\" with hash = 0x513AEC0A\nDiscovered logging message: \"Warning message {}\" with hash = 0xF7854660\nDiscovered logging message: \"Error message {}\" with hash = 0x665B8AC6\nDiscovered logging message: \"Fatal message {}\" with hash = 0x77CD9E8E\n```\n\n## Hash log builder\nHash log builder python script is used to parse C++ source files  (*.h,  *.inl,\n*.cpp) for logging messages, calculate their hash codes and  generate  .hashlog\nmap file.\n\n```shell\nusage: hashlog-map command\nSupported commands:\n        help - show this help\n        version - show version\n        generate - generate .hashlog\n        view - view .hashlog\n```\n\nHash log builder python script can be installed using python pip:\n```shell\npip3 install hashlog-map\n```\n\nFor example for the following C++ code:\n```c++\nlogger.Debug(\"Debug message {}\", 1);\nlogger.Info(\"Info message {}\", 2);\nlogger.Warn(\"Warning message {}\", 3);\nlogger.Error(\"Error message {}\", 4);\nlogger.Fatal(\"Fatal message {}\", 5);\n```\n\nGenerated .hashlog will be:\n```shell\nhashlog-map generate\nDiscovered logging message: \"Debug message {}\" with hash = 0xEC3CF96D\nDiscovered logging message: \"Info message {}\" with hash = 0x513AEC0A\nDiscovered logging message: \"Warning message {}\" with hash = 0xF7854660\nDiscovered logging message: \"Error message {}\" with hash = 0x665B8AC6\nDiscovered logging message: \"Fatal message {}\" with hash = 0x77CD9E8E\n```\n\nIt is possible to shop .hashlog content in human readable  format  with  'view'\ncommand:\n```shell\nhashlog-map view\n0xEC3CF96D: Debug message {}\n0x513AEC0A: Info message {}\n0xF7854660: Warning message {}\n0x665B8AC6: Error message {}\n0x77CD9E8E: Fatal message {}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchronoxor%2Fcpplogging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchronoxor%2Fcpplogging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchronoxor%2Fcpplogging/lists"}