{"id":13420402,"url":"https://github.com/0xmalloc/c-log","last_synced_at":"2025-03-15T06:33:03.224Z","repository":{"id":9631464,"uuid":"11561510","full_name":"0xmalloc/c-log","owner":"0xmalloc","description":"a fast ,stable and thread-safe log lib(logger) for C/C++ language","archived":false,"fork":false,"pushed_at":"2018-04-08T17:13:15.000Z","size":53,"stargazers_count":248,"open_issues_count":0,"forks_count":129,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-07-31T22:55:03.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xmalloc.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":"2013-07-21T12:43:27.000Z","updated_at":"2024-07-15T08:56:42.000Z","dependencies_parsed_at":"2022-08-18T03:45:53.783Z","dependency_job_id":null,"html_url":"https://github.com/0xmalloc/c-log","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xmalloc%2Fc-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xmalloc%2Fc-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xmalloc%2Fc-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xmalloc%2Fc-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xmalloc","download_url":"https://codeload.github.com/0xmalloc/c-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221553276,"owners_count":16841997,"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":[],"created_at":"2024-07-30T22:01:32.915Z","updated_at":"2024-10-26T16:30:25.211Z","avatar_url":"https://github.com/0xmalloc.png","language":"C","readme":"## C-LOG\r\n[![Release Version](https://img.shields.io/badge/release-1.0.0-red.svg)](https://github.com/0xmalloc/c-log/releases) \r\n\r\n## What is c-log\r\na fast ,stable and thread-safe log lib(logger) for C/C++ language\r\n\r\n## How to Use \r\nyou can use  \"sh build.sh\" to build the testing application and also i suggest you to `run \"./bench_test\" (single_thread)to see the performance`\r\n\r\nyou can use this log module by the follow  guiding:\r\n```cpp\r\n    log_init(LL_TRACE, \"mysql\", \"./log/\");\r\n\tLOG_NOTICE(\"%s [time:%d]\", \"test calling log\", time(NULL));\r\n\tLOG_DEBUG(\"debug msg,only write to log when the loglevel bigger than or equal to debug [time:%d]\", time(NULL));\r\n\tLOG_WARN(\"warnning msg will be writing to the error files [time:%d]\", time(NULL));\r\n\tLOG_ERROR(\"you also can change  number of output files by rewrite the macro_define.h\");\r\n```\r\nand also you don't need to call close befor your application exit\r\nif you insist to calling close,please use WARN_W.log_close() INFO_W.log_close() and so so.\r\n\r\nthis module also provide some convenient macro, you can use it in the following scene\r\n```cpp\r\n    int function()\r\n\t{\r\n\t\tint ret;\r\n\t\tif()\r\n\t\t{\r\n\t\t\tret = function_call();\r\n\t\t\tMACRO_RET(ret != 0, -1);\r\n\t\t\tMACRO_WARN(ret != 0, \"function call failed  [ret:%d]\", ret);\r\n\t\t\tMACRO_WARN_RET(ret != 0, -1, \"function call failed  [ret:%d]\", ret)\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n```\r\nThe performance of this log module is really depend on how fast your disk is.\r\nhere is test result:\r\n\r\n    case 1\r\n        Record Size: 280kb\r\n    \tCost Time: 42 seconds\r\n    \tData File Size: 20GB\r\n    \tyes. we write 20GB file in 102s,that's means we write 200MB per second.and\r\n    \talso this is the limitation of SATA.\r\n\r\n    case 2 \r\n        Record Size: 56byte\r\n    \tRecord Write per Senconds:200,000\r\n    \tyes,in it's general useage,you can gain high qps from this log module\r\n\r\nwhat will be the next?\r\n\r\n\r\n## About Author\r\n\r\n```javascript\r\n  var 0xmalloc = {\r\n    nickName  : \"zealot yin\",\r\n    email : '0xmalloc@gmail.com',\r\n    site : \"http://www.cnblogs.com/Creator/\"\r\n    weibo : \"http://www.weibo.com/zealotyin\"\r\n  }\r\n```\r\n","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xmalloc%2Fc-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xmalloc%2Fc-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xmalloc%2Fc-log/lists"}