{"id":20520071,"url":"https://github.com/s-mv/loggr","last_synced_at":"2025-07-15T03:39:07.799Z","repository":{"id":167549210,"uuid":"461231123","full_name":"s-mv/loggr","owner":"s-mv","description":"Logging library with levels, made in C.","archived":false,"fork":false,"pushed_at":"2022-03-01T09:01:55.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T00:18:24.451Z","etag":null,"topics":["c","debugging","logging"],"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/s-mv.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":"2022-02-19T15:26:25.000Z","updated_at":"2023-10-14T10:38:53.000Z","dependencies_parsed_at":"2023-05-23T01:00:32.627Z","dependency_job_id":null,"html_url":"https://github.com/s-mv/loggr","commit_stats":null,"previous_names":["s-mv/loggr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/s-mv/loggr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-mv%2Floggr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-mv%2Floggr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-mv%2Floggr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-mv%2Floggr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s-mv","download_url":"https://codeload.github.com/s-mv/loggr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-mv%2Floggr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265398193,"owners_count":23758467,"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","debugging","logging"],"created_at":"2024-11-15T22:17:44.797Z","updated_at":"2025-07-15T03:39:07.568Z","avatar_url":"https://github.com/s-mv.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# loggr\n\n\u003e by smv\n\nExtra layer on top of printf to make logging easier!  \nWith loggr you can set logging levels to make things easier.\n\n## Contents.\n- [Installation.](#installation)\n- [Compile commands.](#compile-commands)\n- [Usage.](#usage)\n- [Help me.](#help-me)\n\n## Installation.\nInstall on Linux by running:  \n`sudo make install` or  \n`make install DIR=/path/to/directory`  \nFor any other OS just generate files with `make install DIR=/path/to/directory` and place `libloggr.so` and `loggr.h` in your working directory.\n\n### Compile commands.\n`gcc main.c -lloggr -o main`  \nor maybe `gcc main.c -L /path/to/library -lloggr -o main`\n\n## Usage.\n### Actually logging stuff. :P\n- `Debug(text, ...)` - for logging debugging info\n- `Log(text, ...)` - for logging normal messages\n- `Warning(text, ...)` - _warns_\n- `Error(text, ...)` - displays an error\n\n### Options.\n- `SetLogLevel(level)` - sets the level of severity for messages to be shown so logs can be filtered\n- `SetColors(yes)` - sets if text should be _coloured_\n- `SetLabels(yes)` - sets if _labels_ should be used or not\n\n### Example.\n```c\n#include \u003cloggr.h\u003e\n\nint main() {\n  SetLabels(1);  // enables labels\n  SetColors(0);  // disables colours\n  SetLogLevel(WARN);  // now only warnings/errors will be displayed\n  Log(\"Hello!\");\n  Warn(\"Warning. :o\");\n  Error(\"The example ended.\");\n  return 0;\n}\n```\nOutputs:\n```\n(WARN)  Warning. :o\n(ERROR) The example ended.\n```\n\nA more detailed example is located at [example.c](example.c). Run `make test \u0026\u0026 ./loggr` to see the output.\n\n## Help me.\nBy suggesting what I could add to this library!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs-mv%2Floggr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs-mv%2Floggr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs-mv%2Floggr/lists"}