{"id":13514760,"url":"https://github.com/exoticlibraries/liblogax","last_synced_at":"2025-03-31T03:31:17.949Z","repository":{"id":40351617,"uuid":"429387565","full_name":"exoticlibraries/liblogax","owner":"exoticlibraries","description":"Blazing fast, simple and modular header-only logging library with zero allocation for C and C++, implemented in C90. Allow logging into various output formats such as Key-Value and JSON.","archived":false,"fork":false,"pushed_at":"2022-05-13T12:55:20.000Z","size":596,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-01T18:37:49.062Z","etag":null,"topics":["c","c-plus-plus","c90","fast","json","key-value","logger","logging","text"],"latest_commit_sha":null,"homepage":"https://301s.github.io/?ll","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/exoticlibraries.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}},"created_at":"2021-11-18T10:32:06.000Z","updated_at":"2024-10-15T18:57:37.000Z","dependencies_parsed_at":"2022-08-09T18:00:15.228Z","dependency_job_id":null,"html_url":"https://github.com/exoticlibraries/liblogax","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exoticlibraries%2Fliblogax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exoticlibraries%2Fliblogax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exoticlibraries%2Fliblogax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exoticlibraries%2Fliblogax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exoticlibraries","download_url":"https://codeload.github.com/exoticlibraries/liblogax/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413377,"owners_count":20773053,"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":["c","c-plus-plus","c90","fast","json","key-value","logger","logging","text"],"created_at":"2024-08-01T05:01:01.409Z","updated_at":"2025-03-31T03:31:14.631Z","avatar_url":"https://github.com/exoticlibraries.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"\n![](https://github.com/exoticlibraries/liblogax/raw/main/docs/liblogax.png)\n\n# liblogax\n\nBlazing fast, simple and modular header-only logging library with zero allocation for C and C++, implemented in C90. Allow logging into various output formats such as Key-Value and JSON.\n\nLogax is designed with speed and modularity in mind,. It requires no heap-allocated memory. Each components can be excluded by defining an [exclusion macro](#modularity), to adjust to an environment or increase compile/runtime speed.\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tlogax_write_text_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_TRACE, \"%s\", \"This is a trace output\");\n\tlogax_write_text_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_DEBUG, \"%s\", \"This is a debug output\");\n\tlogax_write_text_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_INFO, \"%s\", \"This is an info output\");\n\tlogax_write_text_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_WARN, \"%s\", \"This is a warning output\");\n\tlogax_write_text_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_ERROR, \"%s\", \"This is an error output\");\n\tlogax_write_text_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_FATAL, \"%s\", \"This is a fatal output\");\n}\n```\n\nOutput\n\n![](https://raw.githubusercontent.com/exoticlibraries/exoticlibraries.github.io/main/assets/images/liblogax/crash_test_output.png)\n\nThe log output can be formatted as text, key/value or json. Where the output is not required or the platform does not have any output stream (e.g. Arduino, stm32) a callback can be registered that will process the log event.\n\n___\n\n## Table of content\n- [Features](#features)\n- [Standards Compliance and Portability](#standards-compliance-and-portability)\n- [Installation](#installation)\n    - [Install](#install)\n        - [Windows](#windows)\n        - [Unix, Linux, Mac](#unix-linux-mac)\n        - [Other platforms](#other-platforms)\n- [Documentation](#documentation)\n- [Usage](#usage)\n    - [Logging without LogaxLogger](#logging-without-logaxLogger)\n    - [Logging with LogaxLogger](#logging-with-logaxLogger)\n\t\t- [Iinitialized LogaxLogger](#iinitialized-logaxLogger)\n\t\t- [LogaxLogger Loggers](#logaxLogger-loggers)\n    - [Callbacks](#callbacks)\n    - [Output Formats](#output-formats)\n\t\t- [Text](#text)\n\t\t- [Key Value](#key-value)\n\t\t- [JSON](#json)\n- [Modularity](#modularity)\n\t- [LOGAX_USE_OLD_CONSOLE_MODE](#logax_use_old_console_mode)\n\t- [LOGAX_NO_OUTPUT_STREAM](#logax_no_output_stream)\n\t- [LOGAX_LOGGER_NO_CALLBACK](#logax_logger_no_callback)\n\t- [LOGAX_LOGGER_NO_OUTPUT_STREAM](#logax_logger_no_output_stream)\n\t- [LOGAX_NO_TIME](#logax_no_time)\n\t- [LOGAX_NO_COLORING](#logax_no_coloring)\n- [How it works](#how-it-works)\n- [Contributing](#contributing)\n- [References](#references)\n- [License](#license)\n\n## Features\n\n- Single header only, just download logax.h and you are good to go.\n- Speed. logax was developed with speed and zero performance intrusion in mind.\n- Modular, excluded un-used features from your test, [modularity](https://exoticlibraries.github.io/liblogax/docs/modularity.html).\n- Zero allocation, No memory allocation.\n- Levelled logging to customize and differentiate the outputs.\n- Support for callbacks and hooks.\n- Very portable, compatible with ANSI C and C++98 without any trade off in functionalities.\n- Output log in text, key-value and JSON encoding formats.\n- Pretty logging for all supported output formats.\n- Simple method to achieve options in the logging system using bitwise operations.\n- Detail documentation with examples and API references.\n\n## Standards Compliance and Portability\n\nThe project is compliant with the original C language specification ISO/IEC 9899:1990 and the first POSIX specification IEEE Std 1003.1-1988 which ensures the project compatibility in various environments.\n\nEven though the project is designed for C, but also works with C++ as it is compatible with C++98 Standard (ISO/IEC 14882:1998), C++03 Standard (ISO/IEC 14882:2003) and C++11 Standard (ISO/IEC 14882:2011).\n\nThe project can be used with any C or C++ compiler. There are optional macros and options that can be used to attain the desired output in the case of undesired results.\n\n## Installation\n\nIf you install the library file `logax.h` using any of the commands below, it can be included in your test like `\u003cexotic/logax.h\u003e`.\n\n### Windows\n\nInstall the library using powershell. It auto detect your installed C and C++ compilers include directory and install liblogax into the include folder. Execute the command in powershell as admin.\n\n```powershell\n\u0026 $([scriptblock]::Create((New-Object Net.WebClient).DownloadString(\"https://exoticlibraries.github.io/magic/install.ps1\"))) liblogax\n```\n\n### Unix, Linux, Mac\n\nUse the remote installation script to install liblogax with bash. If the command is executes with super user priviledge (sudo) it will be installed in the folder /usr/include else it will be installed in the folder /usr/local/include. Or you can specify where to install it using the option `--installfolder=./` \n\n```bash\nbash \u003c(curl -s https://exoticlibraries.github.io/magic/install.sh) liblogax\n```\n\n### Other platforms\n\nYou can simply download the header file `logax.h` from the repo into your project source folder and include it in your project. Download the file from [here](https://github.com/exoticlibraries/liblogax/blob/main/include/exotic/logax.h). Then you can include it in your test relatively like `#include \"logax.h\"`.\n\n## Documentation\n\nThe [documentation](https://exoticlibraries.github.io/liblogax/docs/) provides several examples, tutorials, and detailed guides for using the library. While [reference](https://exoticlibraries.github.io/liblogax/reference/) provides a low-level overview of all the implemented APIs in the library. \n\nSome of the documentation pages are listed below:\n\n - [Logging without LogaxLogger](https://exoticlibraries.github.io/liblogax/docs/logging_without_logaxlogger.html)\n - [Logging with LogaxLogger](https://exoticlibraries.github.io/liblogax/docs/logging_with_logaxlogger.html)\n - [Modularity](https://exoticlibraries.github.io/liblogax/modularity.html)\n - [Logging levels](https://exoticlibraries.github.io/liblogax/logging_levels.html)\n - [Output Formats](https://exoticlibraries.github.io/liblogax/docs/output_formats.html)\n - [Callback and Hook](https://exoticlibraries.github.io/liblogax/docs/callback.html)\n - [Options](https://exoticlibraries.github.io/liblogax/docs/options.html)\n - [How it works](https://exoticlibraries.github.io/liblogax/how_it_works/index.html)\n\n## Usage\nit allows the log to be reported to custom function with optional printing to output stream. The default maximum number of callback that can be registered is 5.\n\n### Logging without LogaxLogger\n\nThe library can be used to output log without need to setup the `LogaxLogger` struct, this will require the platform to have output stream or can write to file. If the macro LOGAX_NO_LOGGER is defined before including the logax.h header file, the LogaxLogger struct and all related functions will not be compiled. The following functions provides the API to write to output stream in the supported formats\n\n- logax_write_text_format_to_stream\n- logax_write_key_value_format_to_stream\n- logax_write_json_format_to_stream\n\n`logax_write_text_format_to_stream` write the output in plain text format, the first parameter is the stream, followed by the options, the options is the combinations of any of the LOGAX_OPTION_*, LOGAX_LEVEL_* and LOGAX_FORMATTER_* macros.\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tlogax_write_text_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_TRACE, \"%s\", \"Enemy approaching from X=108,Y=877\");\n}\n\n// output\n// 2021-11-21 06:34:07 TRACE crash_test.c:13 Logging the test for TRACE\n```\n\n`logax_write_key_value_format_to_stream` write the output in a key-value format coloring is ignored in this format, the first parameter is the stream, followed by the options, the options is the combinations of any of the LOGAX_OPTION_*, LOGAX_LEVEL_* and LOGAX_FORMATTER_* macros.\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tlogax_write_key_value_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_TRACE, \"%s\", \"Enemy approaching from X=108,Y=877\");\n}\n\n// output\n// date=\"2021-11-21\" time=\"06:41:34\" level=\"TRACE\" file=\"crash_test.c\" line_number=8 function=\"main\" message=\"This is a trace output\"\n```\n\n`logax_write_json_format_to_stream` write the output in a json format, the first parameter is the stream, followed by the options, the options is the combinations of any of the LOGAX_OPTION_*, LOGAX_LEVEL_* and LOGAX_FORMATTER_* macros.\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tlogax_write_json_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_TRACE, \"%s\", \"Enemy approaching from X=108,Y=877\");\n}\n\n// output\n// {\"date\":\"2021-11-21\",\"time\":\"06:42:25\",\"level\":\"TRACE\",\"file\":\"crash_test.c\",\"line_number\":8,\"function\":\"main\",\"message\":\"This is a trace output\"},\n```\n\n### Logging with LogaxLogger\n\nIn a situation where callback is needed, no FILE* ability on the platform or the flags/options want to be shared across the log, the `LogaxLogger` struct can be used. No memory allocation is required when initialized.\n\n#### Iinitialized LogaxLogger\n\nTo iinitialized the LogaxLogger the function `logax_init_logger` can be used, it not necessary to call the logax_init_logger function, all it does is set the LogaxLogger flags to default value, output_stream to stdout and fill the empty callbacks with NULL, these can be self-managed.\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tLogaxLogger logax_logger;\n\tlogax_init_logger(\u0026logax_logger);\n}\n```\n\n#### LogaxLogger Loggers\n\nFor each of the logging level in logax a function is provider that accepts `LogaxLogger` struct as parameter:\n\n- logax_logger_trace\n- logax_logger_debug\n- logax_logger_info\n- logax_logger_warn\n- logax_logger_error\n- logax_logger_fatal\n\nEach of the function above invoke the corresponding `logax_write_*_format_to_stream` respectively, the default formatter when LogaxLogger is initialized with the function logax_init_logger is `LOGAX_FORMATTER_TEXT`, the output format can be changed using the function `logax_set_formatter`.\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tLogaxLogger logax_logger;\n\tlogax_init_logger(\u0026logax_logger);\n\n\tlogax_set_formatter(\u0026logax_logger, LOGAX_FORMATTER_TEXT);\n\tlogax_logger_trace(\u0026logax_logger, \"%s\", \"Logging the test for TRACE\");\n\tlogax_logger_debug(\u0026logax_logger, \"%s\", \"Logging the test for DEBUG\");\n\tlogax_logger_info(\u0026logax_logger, \"%s\", \"Logging the test for INFO\");\n\tlogax_logger_warn(\u0026logax_logger, \"%s\", \"Logging the test for WARN\");\n\tlogax_logger_error(\u0026logax_logger, \"%s\", \"Logging the test for ERROR\");\n\tlogax_logger_fatal(\u0026logax_logger, \"%s\", \"Logging the test for FATAL\");\n}\n```\n\n### Callbacks\n\nLogaxLogger supports callback (or hook), the callbacks are invoked when a new log is sent. The callback can be used to create a custom output format or used to changed out the log is processed (e.g. blink bulb on andruino e.t.c). The output stream can be completely disabled by defining the macro `LOGAX_NO_OUTPUT_STREAM` or setting the option to QUIET using the function `logax_set_quiet`, in this case if callbacks are registered they will be invoked with the log event.\n\nThe callback function signature is\n\n```c\ntypedef void (*logax_callback)(const char *date, const char *time, const int level, const char *file, const size_t line_number, const char *function_name, const char *fmt, ...);\n```\n\nThe example below shows how to register a callback which is invoked when there is a new log\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nvoid on_new_log_callback(const char *date, const char *time, const int level, const char *file, const size_t line_number, const char *function_name, const char *fmt, ...) {\n\tva_list args;\n\tprintf(\"\u003clogevent\u003e\");\n\tprintf(\"\\n  \u003cdate\u003e%s\u003c/date\u003e\", date);\n\tprintf(\"\\n  \u003ctime\u003e%s\u003c/time\u003e\", time);\n\tprintf(\"\\n  \u003clevel\u003e%s\u003c/level\u003e\", GET_LEVEL_STRING(level));\n\tprintf(\"\\n  \u003cfile\u003e%s\u003c/file\u003e\", file);\n\tprintf(\"\\n  \u003cline_number\u003e%d\u003c/line_number\u003e\", line_number);\n\tprintf(\"\\n  \u003cfunction_name\u003e%s\u003c/function_name\u003e\", function_name);\n\tprintf(\"\\n  \u003cmessage\u003e\");\n\tva_start(args, fmt);vfprintf(stdout, fmt, args);va_end(args);\n\tprintf(\"\u003c/message\u003e\\n\u003c/logevent\u003e\\n\");\n}\n\nint main(int argc, char **argv) {\n\tLogaxLogger logax_logger;\n\n\tlogax_init_logger(\u0026logax_logger);\n\tlogax_set_quiet(\u0026logax_logger, 1);\n\tlogax_logger_add_callback(\u0026logax_logger, on_new_log_callback);\n\tlogax_logger_trace(\u0026logax_logger, \"%s\", \"Logging the test for TRACE\");\n\tlogax_logger_debug(\u0026logax_logger, \"%s\", \"Logging the test for DEBUG\");\n\tlogax_logger_info(\u0026logax_logger, \"%s\", \"Logging the test for INFO\");\n\tlogax_logger_warn(\u0026logax_logger, \"%s\", \"Logging the test for WARN\");\n\tlogax_logger_error(\u0026logax_logger, \"%s\", \"Logging the test for ERROR\");\n\tlogax_logger_fatal(\u0026logax_logger, \"%s\", \"Logging the test for FATAL\");\n}\n```\n\nThis gives the following outputs the in XML format as defined in the `on_new_log_callback` function:\n\n```xml\n\u003clogevent\u003e\n  \u003cdate\u003e2021-11-21\u003c/date\u003e\n  \u003ctime\u003e07:26:02\u003c/time\u003e\n  \u003clevel\u003eTRACE\u003c/level\u003e\n  \u003cfile\u003eC:\\Users\\azeez\\Documents\\OPEN_SOURCE\\EXOTIC_LIBRARIES\\liblogax\\test\\crash_test.c\u003c/file\u003e\n  \u003cline_number\u003e25\u003c/line_number\u003e\n  \u003cfunction_name\u003emain\u003c/function_name\u003e\n  \u003cmessage\u003eLogging the test for TRACE\u003c/message\u003e\n\u003c/logevent\u003e\n\u003clogevent\u003e\n  \u003cdate\u003e2021-11-21\u003c/date\u003e\n  \u003ctime\u003e07:26:02\u003c/time\u003e\n  \u003clevel\u003eDEBUG\u003c/level\u003e\n  \u003cfile\u003eC:\\Users\\azeez\\Documents\\OPEN_SOURCE\\EXOTIC_LIBRARIES\\liblogax\\test\\crash_test.c\u003c/file\u003e\n  \u003cline_number\u003e26\u003c/line_number\u003e\n  \u003cfunction_name\u003emain\u003c/function_name\u003e\n  \u003cmessage\u003eLogging the test for DEBUG\u003c/message\u003e\n\u003c/logevent\u003e\n...\n```\n\n### Output Formats\n\nliblogax currently support only three output format, which are text, key-value and json. To set the output format of a LogaxLogger struct use the function `logax_set_formatter`. The following are the format options:\n\n- LOGAX_FORMATTER_TEXT\n- LOGAX_FORMATTER_KEY_VALUE\n- LOGAX_FORMATTER_JSON\n\n#### Text\n\nOutput as text using `logax_write_text_format_to_stream`\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tlogax_write_text_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_TRACE, \"%s\", \"Enemy approaching from X=108,Y=877\");\n}\n```\n```\n2021-11-21 08:41:19 TRACE crash_test.c:6  --- [main     ] Enemy approaching from X=108,Y=877\n```\n\nOutput as text using the `LOGAX_FORMATTER_TEXT` option with LogaxLogger.\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tLogaxLogger logax_logger;\n\n\tlogax_init_logger(\u0026logax_logger);\n\tlogax_set_formatter(\u0026logax_logger, LOGAX_FORMATTER_TEXT);\n\tlogax_logger_trace(\u0026logax_logger, \"%s\", \"Enemy approaching from X=108,Y=877\");\n}\n```\n```\n2021-11-21 08:38:38 TRACE crash_test.c:10 Enemy approaching from X=108,Y=877\n```\n\n#### Key Value\n\nOutput as key value using `logax_write_key_value_format_to_stream`\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tlogax_write_key_value_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_TRACE, \"%s\", \"Enemy approaching from X=108,Y=877\");\n}\n```\n```\ndate=\"2021-11-21\" time=\"08:43:59\" level=\"TRACE\" file=\"crash_test.c\" line_number=6 function=\"main\" message=\"Enemy approaching from X=108,Y=877\"\n```\n\nOutput as key value using the `LOGAX_FORMATTER_KEY_VALUE` option with LogaxLogger.\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tLogaxLogger logax_logger;\n\n\tlogax_init_logger(\u0026logax_logger);\n\tlogax_set_formatter(\u0026logax_logger, LOGAX_FORMATTER_KEY_VALUE);\n\tlogax_logger_trace(\u0026logax_logger, \"%s\", \"Enemy approaching from X=108,Y=877\");\n}\n```\n```\ndate=\"2021-11-21\" time=\"08:46:00\" level=\"TRACE\" file=\"crash_test.c\" line_number=10 message=\"Enemy approaching from X=108,Y=877\"\n```\n\n#### JSON\n\nOutput as json using `logax_write_json_format_to_stream`\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tlogax_write_json_format_to_stream(stdout, LOGAX_OPTION_ALL | LOGAX_LEVEL_TRACE, \"%s\", \"Enemy approaching from X=108,Y=877\");\n}\n```\n```json\n{\"date\":\"2021-11-21\",\"time\":\"08:44:58\",\"level\":\"TRACE\",\"file\":\"crash_test.c\",\"line_number\":6,\"function\":\"main\",\"message\":\"Enemy approaching from X=108,Y=877\"},\n```\n\nOutput as json using the `LOGAX_FORMATTER_JSON` option with LogaxLogger.\n\n```c\n#include \u003cexotic/logax.h\u003e\n\nint main(int argc, char **argv) {\n\tLogaxLogger logax_logger;\n\n\tlogax_init_logger(\u0026logax_logger);\n\tlogax_set_formatter(\u0026logax_logger, LOGAX_FORMATTER_JSON);\n\tlogax_logger_trace(\u0026logax_logger, \"%s\", \"Enemy approaching from X=108,Y=877\");\n}\n```\n```\n{\"date\":\"2021-11-21\",\"time\":\"08:45:36\",\"level\":\"TRACE\",\"file\":\"crash_test.c\",\"line_number\":10,\"message\":\"Enemy approaching from X=108,Y=877\"},\n```\n\n## Modularity\n\nliblogax is big on modularity, each component of the library can be excluded at compile time. The following macros if defined will exclude some component from the library:\n\n- LOGAX_USE_OLD_CONSOLE_MODE\n- LOGAX_NO_OUTPUT_STREAM\n- LOGAX_LOGGER_NO_OUTPUT_STREAM\n- LOGAX_LOGGER_NO_CALLBACK\n- LOGAX_NO_COLORING\n- LOGAX_NO_TIME\n\n### LOGAX_USE_OLD_CONSOLE_MODE\n\nIf this macro is define the library will use the Windows API to color the log outputs, this macro is only effective on Windows system. This macro is most useful for old windows platform which the console cannot process the ANSI Color Codes.\n\n```\n#define LOGAX_USE_OLD_CONSOLE_MODE\n#include \u003cexotic/logax.h\u003e\n\n//...\n```\n\n\u003e Note that there might slight different in the color variation between using Windows Console attributes and ANSI Color codes\n\n### LOGAX_NO_OUTPUT_STREAM\n\nIf this macro is defined the library will not be compiled with the writing to stream feature, both explicit write to streams function `logax_write_*_format_to_stream` and LogaxLogger loggers will not write to stream, but the callback will still be invoked is any is registered.\n\n```c\n#define LOGAX_NO_OUTPUT_STREAM\n#include \u003cexotic/logax.h\u003e\n\n//...\n```\n\n### LOGAX_LOGGER_NO_OUTPUT_STREAM\n\nIf this macro is defined the LogaxLogger struct will not be compiled with the writing to stream capability, but the explicit writing to stream functions `logax_write_*_format_to_stream` will be have the write to stream capability.\n\n```c\n#define LOGAX_LOGGER_NO_OUTPUT_STREAM\n#include \u003cexotic/logax.h\u003e\n\n//...\n```\n\n### LOGAX_LOGGER_NO_CALLBACK\n\nDefine this macro to exclude the callback and hook feature of the library, this does not affect the writing to output stream. You can still write the statement to register hook if needed but it ll have no effect unless this macro is removed.\n\n```c\n#define LOGAX_LOGGER_NO_CALLBACK\n#include \u003cexotic/logax.h\u003e\n\n//...\n```\n\n### LOGAX_NO_COLORING\n\nIf this macro is define the library will not be compiled with pretty print capability. The flag `LOGAX_OPTION_COLORED` will also not be available for use to customize the output.\n\n```c\n#define LOGAX_NO_COLORING\n#include \u003cexotic/logax.h\u003e\n\n//...\n```\n\n### LOGAX_NO_TIME\n\nOn a system that does not have floating point capability or the time headers are not available this macro can be defined to exclude adding data and time capability to the logging. Defining this macro will make the following macros unavailable `LOGAX_OPTION_DATE`, `LOGAX_OPTION_TIME`, `LOGAX_OPTION_DATE_TIME`.\n\n```c\n#define LOGAX_NO_TIME\n#include \u003cexotic/logax.h\u003e\n\n//...\n```\n\n## How it works\n\nThese three internal functions are responsible for the actual logging to output stream,\n- logax_write_text_format_to_stream\n- logax_write_key_value_format_to_stream\n- logax_write_json_format_to_stream\n\nThe functions accept variadic parameters, the first 3 parameters are compulsory and the followed X parameters are for the vfprintf function for formatting. The first parameter is the output stream `FILE *`, the second parameters is the flags to customize the outputs, the third parameter is the fmt to processes the variadic values. \n\n`LogaxLogger` struct allows logging properties and output stream to be shared across function calls, it internally uses the 3 functions above to output the log. The special feature of LogaxLogger is the callback. On new log entry all the registered callbacks are invoked with the log event. \n\nSee the pages at [how it works](https://exoticlibraries.github.io/liblogax/how_it_works/index.html) for more explanation.\n\n## Contributing\n\nIf you have any issue or you want to request a feature you can open a request [here](https://github.com/exoticlibraries/liblogax/issues/new/choose) anytime and if you made some changes that should be added to the main project send in a [pull request](https://github.com/exoticlibraries/liblogax/compare). \n\n## References\n\n - [ANSI C](https://en.wikipedia.org/wiki/ANSI_C)\n - [Exotic Libraries](https://exoticlibraries.github.io/)\n - [Author](https://thecarisma.github.io/)\n - \u003ca target=\"_blank\" href=\"https://icons8.com/icon/84401/login\"\u003eLogin\u003c/a\u003e icon by \u003ca target=\"_blank\" href=\"https://icons8.com\"\u003eIcons8\u003c/a\u003e\n\n## License\n\nMIT License Copyright (c) 2021, Adewale Azeez \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexoticlibraries%2Fliblogax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexoticlibraries%2Fliblogax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexoticlibraries%2Fliblogax/lists"}