{"id":24994985,"url":"https://github.com/slayers-git/slog","last_synced_at":"2025-07-09T20:07:30.042Z","repository":{"id":275697472,"uuid":"385982788","full_name":"slayers-git/slog","owner":"slayers-git","description":"Fast and customizable logging library for C/C++","archived":false,"fork":false,"pushed_at":"2022-05-25T13:26:03.000Z","size":57,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T14:25:06.749Z","etag":null,"topics":["c89","customizable","library","logging"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slayers-git.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":"2021-07-14T15:11:38.000Z","updated_at":"2021-12-07T01:39:35.000Z","dependencies_parsed_at":"2025-02-04T04:41:38.242Z","dependency_job_id":null,"html_url":"https://github.com/slayers-git/slog","commit_stats":null,"previous_names":["slayers-git/slog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/slayers-git/slog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slayers-git%2Fslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slayers-git%2Fslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slayers-git%2Fslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slayers-git%2Fslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slayers-git","download_url":"https://codeload.github.com/slayers-git/slog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slayers-git%2Fslog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502621,"owners_count":23618658,"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":["c89","customizable","library","logging"],"created_at":"2025-02-04T15:25:52.816Z","updated_at":"2025-07-09T20:07:30.020Z","avatar_url":"https://github.com/slayers-git.png","language":"C","readme":"# slog\n\nslog is a fast and customizable logging library written in C89.\n\n## Features\n\n- Custom formats for the output\n- Optionally colored output\n- Certain log levels can be suppressed\n\n## Example\n\n```c\n#include \u003cslog/slog.h\u003e\n\nint main (void) {\n    slog_stream *logger = slog_create (\"mylog.txt\", slog_flags_none);\n    if (!logger)\n        return -1;\n    if (slog_format (logger, \"[%l] %d/%M/%Y: %L\") != 0) {\n        return -2;\n    }\n    slog_message (logger, \"My message\");\n    const char *message = \"message\";\n    slog_printf (logger, slog_loglevel_message, \"My formatted %s\", message);\n\n    slog_colorized (logger, 1);\n    slog_error (logger, \"This message now will be red (if the OS supports it)\");\n    slog_debug (logger, \"You won't see this message unless...\");\n    slog_suppress (logger, SLOG_SUPPRESS_NOTHING);\n    slog_debug (logger, \"Now this message is visible!\");\n\n    slog_close (logger);\n    return 0;\n}\n```\n\nMore informative examples can be found in `test/` directory.\n\n## Format\n\nYou can use the following symbols to describe your log format:\n\n- %c - standart time representation (see: acstime ())\n- %h - hours (12h)\n- %H - hours (24h)\n- %m - minutes\n- %s - seconds\n- %d - days\n- %M - months\n- %y - years [2 digit]\n- %Y - years [4 digit]\n- %l - log level\n- %L - message\n- %p - seconds since the start of the program\n- %P - seconds since 01/01/1970\n\n## Building\n\nTo build and install slog library on a \\*nix system, in your shell type:\n```bash\nmkdir build \u0026\u0026 cd build\\\ncmake ../ \u0026\u0026 make \u0026\u0026 sudo make install\n```\n\nYou can also compile the contents of the `test/` directory by appending `-DSLOG_EXAMPLES=1` to the `cmake` command.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslayers-git%2Fslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslayers-git%2Fslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslayers-git%2Fslog/lists"}