# log **Repository Path**: zcy543814/log ## Basic Information - **Project Name**: log - **Description**: a simple printf wrapper for c/c++ - **Primary Language**: C - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-05-27 - **Last Updated**: 2021-08-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LOG [![Build Status](https://github.com/shuai132/LOG/workflows/build/badge.svg)](https://github.com/shuai132/LOG/actions?workflow=build) LOG for C/C++ project, by wrapper and enhance `printf`. ## Features * Support C and C++ * Single header file * With color on Unix platform * Auto print filename and lines * Auto line feed by `\n`, can be replaced to `\r\n` by define `LOG_LINE_END_CRLF` * Release mode(if defined `NDEBUG` or defined `LOG_NDEBUG`) `LOGD` will be ignored ## Usage example.c ```c #define LOG_NOT_EXIT_ON_FATAL #include "log.h" int main() { LOG("log"); LOGT("T", "msg with tag"); LOGD("debug"); LOGI("info"); LOGW("warn"); LOGE("error"); FATAL("fatal error"); return 0; } ``` Output: ```text [V]: log [T]: msg with tag [D]: example.c: debug [I]: example.c: info [W]: example.c: main: 9: warn [E]: example.c: main: 10: error [F]: example.c: main: 11: fatal error ```