{"id":24168704,"url":"https://github.com/sh7ven/clog","last_synced_at":"2025-06-13T22:07:24.984Z","repository":{"id":252836458,"uuid":"841608410","full_name":"sh7ven/Clog","owner":"sh7ven","description":"A header-only, simple and thread-safe logging library written in C.","archived":false,"fork":false,"pushed_at":"2025-01-10T08:12:05.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T18:35:47.213Z","etag":null,"topics":["c","lightweight","logging","simple","thread-safe"],"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/sh7ven.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":"2024-08-12T18:43:56.000Z","updated_at":"2025-01-10T08:12:08.000Z","dependencies_parsed_at":"2024-11-13T13:47:20.449Z","dependency_job_id":"232a5665-b8d2-4c82-8700-e986701a64f3","html_url":"https://github.com/sh7ven/Clog","commit_stats":null,"previous_names":["shivenkashyapp/clog","thesvn/clog","sh7ven/clog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sh7ven/Clog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sh7ven%2FClog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sh7ven%2FClog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sh7ven%2FClog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sh7ven%2FClog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sh7ven","download_url":"https://codeload.github.com/sh7ven/Clog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sh7ven%2FClog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259727134,"owners_count":22902181,"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","lightweight","logging","simple","thread-safe"],"created_at":"2025-01-12T22:45:19.846Z","updated_at":"2025-06-13T22:07:24.959Z","avatar_url":"https://github.com/sh7ven.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![sample warning](/screenshots/sample_usage_warning.png)\n\n# Clog\nA header-only, simple and thread-safe logging library written in C.\n\n# Installation\nClone the repository and place the source files inside your project.\n```\n$ git clone https://github.com/sh7ven/Clog/\n```\n\nAdd `clog.h` to an include directory, and add it to a build script as well.\n\nFor instance:\n```make\n# File names alongside are Project's dependencies.\n\nProject: include/file1.h src/file1.c ... include/clog.h\n    @gcc $(SOME_FLAGS) -I./include/ src/*\n```\nSee [GNU Make](https://www.gnu.org/software/make/).\n\n# Usage\nThe function definition for logging is:\n```c\nvoid clog_log(clog_priority priority, FILE* stream, const char* fmt, ...)\n```\n\nFor instance\n```c\nclog_log( CLOG_WARN, stdout, \"This is some warning where an invalid access was made to the address %p\", 0x0f0f );\n```\n![sample warning](/screenshots/sample_usage_warning.png)\n\nYou can also use some macros to quickly pipe output, instead of specifying a priority level everytime:\n```\nclog_info(...)\nclog_debug(...)\nclog_warn(...)\nclog_err(...)\n```\n\n# Save logs to file\nYou can instruct Clog to save logs to a backup file as well. \n```c\n// Call this before logging any output. \nclog_backup_logs(true);\n```\n\nThis file is platform specific and is opened as soon you include `clog.h`.\nOn Linux distributions, it is `$XDG_CONFIG_HOME/clogfile` or `$HOME/.config/clogfile`.\nOn Windows, it is `..\\AppData\\clogfile`.\n\n# TODOs\n- Better cross platform support for Windows and Mac.\n- Better thread safety.\n- Pure private functions (hard) to prevent unnecessary problems.\n\n# License\n[MIT](https://opensource.org/license/MIT)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsh7ven%2Fclog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsh7ven%2Fclog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsh7ven%2Fclog/lists"}