{"id":13470417,"url":"https://github.com/goatshriek/stumpless","last_synced_at":"2025-05-15T01:08:10.871Z","repository":{"id":17556510,"uuid":"20359440","full_name":"goatshriek/stumpless","owner":"goatshriek","description":"a fast and feature-rich logging library for C","archived":false,"fork":false,"pushed_at":"2025-05-10T23:57:35.000Z","size":5713,"stargazers_count":470,"open_issues_count":19,"forks_count":346,"subscribers_count":20,"default_branch":"latest","last_synced_at":"2025-05-13T10:56:06.099Z","etag":null,"topics":["c","contributions-welcome","event-log","good-first-issue","journald","library","log","logging","logging-library","sqlite","sqlite3","structured-logging","syslog"],"latest_commit_sha":null,"homepage":"https://goatshriek.github.io/stumpless","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/goatshriek.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":"docs/CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-05-31T16:06:34.000Z","updated_at":"2025-05-13T09:51:53.000Z","dependencies_parsed_at":"2024-02-12T03:29:27.069Z","dependency_job_id":"a1428d5f-e6de-43fe-ab93-a0b7bed394e2","html_url":"https://github.com/goatshriek/stumpless","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goatshriek%2Fstumpless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goatshriek%2Fstumpless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goatshriek%2Fstumpless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goatshriek%2Fstumpless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goatshriek","download_url":"https://codeload.github.com/goatshriek/stumpless/tar.gz/refs/heads/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254042,"owners_count":22039792,"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","contributions-welcome","event-log","good-first-issue","journald","library","log","logging","logging-library","sqlite","sqlite3","structured-logging","syslog"],"created_at":"2024-07-31T16:00:29.985Z","updated_at":"2025-05-15T01:08:05.859Z","avatar_url":"https://github.com/goatshriek.png","language":"C","funding_links":[],"categories":["C","systemd-journald"],"sub_categories":[],"readme":"![Stumpless logo](./assets/logo-and-name.svg)\n\n**A C logging library built for high performance and a rich feature set.**\n\n[![Linux Builds](https://github.com/goatshriek/stumpless/actions/workflows/linux.yml/badge.svg)](https://github.com/goatshriek/stumpless/actions/workflows/linux.yml)\n[![Windows Builds](https://github.com/goatshriek/stumpless/actions/workflows/windows.yml/badge.svg)](https://github.com/goatshriek/stumpless/actions/workflows/windows.yml)\n[![Mac Builds](https://github.com/goatshriek/stumpless/actions/workflows/mac.yml/badge.svg)](https://github.com/goatshriek/stumpless/actions/workflows/mac.yml)\n[![Coverage Report](https://codecov.io/gh/goatshriek/stumpless/branch/latest/graph/badge.svg)](https://codecov.io/gh/goatshriek/stumpless)\n[![SonarCloud Status](https://sonarcloud.io/api/project_badges/measure?project=stumpless\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=stumpless)\n[![Gitter](https://badges.gitter.im/stumpless/community.svg)](https://gitter.im/stumpless/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![Apache 2.0 License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.1-ff69b4.svg)](https://github.com/goatshriek/stumpless/blob/latest/docs/CODE_OF_CONDUCT.md)\n\n\n[한국어](./l10n/ko-kr/README.md) | [简体中文](./l10n/zh-cn/自述.md)\n\n\n[Key Features](#key-features) |\n[Build and Install](#quick-build-and-install) |\n[Basic Usage](#basic-usage) |\n[Contributing](#contributing)\n\n\n## Key Features\nStumpless has lots of features that make logging in C fast and easy:\n * log to [lots of things](#what-can-it-log-to) like Splunk, rsyslog,\n   journald, the Windows Event Log, sqlite, and more!\n * structured and unstructured logging to suit your needs\n * builds on Linux, Windows, Mac, FreeBSD, MinGW, MSYS2, Cygwin, DOS, and more!\n * thread safe\n * can be adjusted or removed during compilation for zero runtime cost\n * localized for multiple languages 🇦🇱 🇧🇷 🇧🇬 🇨🇳 🇨🇿 🇩🇪 🇩🇰 🇪🇸 🇫🇷 🇬🇷 🇭🇺 🇮🇳 🇮🇱 🇮🇹\n   🇯🇵 🇰🇪 🇰🇷 🇵🇱 🇸🇰 🇱🇰 🇸🇪 🇹🇷 🇺🇸\n   ([add yours!](https://github.com/goatshriek/stumpless/blob/latest/docs/localization.md))\n * easy-access\n   [documentation](https://goatshriek.github.io/stumpless/docs/c/latest/),\n   [examples](https://github.com/goatshriek/stumpless/tree/latest/docs/examples),\n   and [support](https://gitter.im/stumpless/community).\n\n\n### What can it log to?\nA primary goal of this library is to provide a consistent logging interface to\na wide variety of log targets. This means you can focus on defining events\nand where you want them to go, without finding other SDKs or adding daemons\nand plugins to get them where you want. Stumpless can write logs to:\n * Simple character buffers\n * Files and streams\n * Unix sockets (such as a local syslog daemon)\n * Network servers (IPv4 or IPv6, TCP or UDP)\n * Systemd Journald service\n * Sqlite3 databases\n * Windows Event Log\n * Custom functions, for whatever else you may need!\n\nDon't see what you need? Create an\n[issue](https://github.com/goatshriek/stumpless/issues/new?template=feature_request.md)\nwith your request and we'll work it into our\n[roadmap](https://github.com/goatshriek/stumpless/blob/latest/docs/roadmap.md)!\n\n\n## Quick Build and Install\nStumpless only requires cmake and a cmake-supported build toolchain (like GCC\nor Visual Studio) to build.\n\n```sh\n# cloning the latest version of the source tree\ngit clone git@github.com:goatshriek/stumpless.git\n\n# creating a new build directory\nmkdir build\ncd build\n\n# configuring the new build\ncmake ../stumpless\n\n# building stumpless (with 4 threads - adjust as desired)\ncmake --build . --parallel 4\n\n# install the library (you probably need sudo to do this)\nsudo cmake --install .\n```\n\nCheck out the [Installation Instructions](INSTALL.md) for more detail on\nbuilding and installing stumpless in different environments and/or with other\ntoolchains.\n\n\n## Basic Usage\nThe simplest way to get started is to use the `stumplog` function as a direct\nreplacement for the standard library's `syslog` function:\n\n```c\n// if you're used to doing this:\nsyslog( LOG_INFO | LOG_USER, \"My message #%d\", count );\n\n// then you can start by changing to this:\nstumplog( LOG_INFO | LOG_USER, \"My message #%d\", count );\n```\n\nIf you haven't opened a target, this will log messages to the default target for\nthe platform: on Linux this is `/dev/log`, on a Mac system this will be\n`/var/run/syslog`, and on a Windows machine it is the Windows Event Log. If you\nopen a target or even a few before calling `stumplog`, then logs will be sent to\nthe most recently opened target.\n\nIf you want an even shorter function call, you can use the `stump` function\nto send a message to the current target. You can also use format specifiers just\nas you would with `printf`:\n\n```c\nstump( \"Login attempt failure #%d for user %s\", count, username );\n```\n\nIf you don't need format specifiers, use one of the `_str` variants:\nit's both faster and safer!\n\n```c\nstump_str( \"Login failure! See structured data for info.\" );\n```\n\nIf you want to open a specific target rather than using the default, then just\nopen the one you need and start sending messages. For example, to log to\na file named `example.log`:\n\n```c\ntarget = stumpless_open_file_target( \"example.log\" );\n\n// uses the last opened target by default\nstump( \"Login attempt failure #%d for user %s\", count, username );\n```\n\nSending messages over the network to something like Splunk or rsyslog is just\nas easy:\n\n```c\ntarget = stumpless_open_udp4_target( \"send-to-splunk-example\",\n                                     \"mylogserver.com\" ); // or use an IP\nstump( \"Login attempt failure #%d for user %s\", count, username );\n```\n\nIf you have multiple targets, you can send messages to a chosen target like\nthis:\n\n```c\nstumpless_add_message( target,\n                       \"Login attempt failure #%d for user %s\",\n                       count,\n                       username );\n```\n\n\n### Severity Shorthand\nIt's common to specify severity levels directly in logging calls, so stumpless\nprovides some macro functions to make this less verbose and more efficient. For\nexample, to log messages with a severity of INFO, you can do this:\n\n```c\nstump_i( \"this gets logged as an info message\" );\n```\n\nAnd if you want to also see source file, line number, and function name info in\neach message you can use `_t` (the 't' is for trace):\n\n```c\nstump_t( \"this includes source info\" );\n```\n\nUsing these functions has the added benefit that they can be removed at\ncompile time by simply defining the `STUMPLESS_ENABLE_UPTO` or\n`STUMPLESS_DISABLE_DOWNTO` symbols. This makes it easy to change logging levels\nbetween builds, for example to have prod and debug versions without differences\nin their source code.\n\n```c\n// be sure to define this before stumpless.h gets included\n#define STUMPLESS_ENABLE_UPTO_INFO\n\n// ...\n\n// this log will go through just fine\nstump_i( \"I'm doing that thing you asked\" );\n\n// this debugging message is completely removed: no runtime impact whatsoever\nstump_d( \"DEBUG info: %d, %d, %s\", thing_1, thing_2, stringy_thingy );\n```\n\nCheck out the headers in\n[stumpless/level](https://github.com/goatshriek/stumpless/tree/latest/include/stumpless/level)\nto see the full list of severity shorthand functions, or the\n[severity level example](https://github.com/goatshriek/stumpless/tree/latest/docs/examples/severity_level)\nto see a complete program in action.\n\n\n### Even more examples\nFor more detailed examples of the above scenarios, usage of specific target\ntypes, how to handle more complicated message structures, and more check out the\n[examples](docs/examples). These include annoted example code files to compile,\nrun, and modify to get you started.\n\n\n## Contributing\nNotice a problem or have a feature request? Just create an issue using one of\nthe templates, and we will respond as quickly as we can. You can also look at\nthe project's [Contribution Guidelines](docs/CONTRIBUTING.md) for more details\non the different ways you can give back to the open source community!\n\nIf you want to actually write some code or make an update yourself, take a look\nat the [development guide](docs/development.md) to get a detailed orientation.\nThere are a few options based on your level of experience and familiarity with\nmaking contributions.\n\nThe first option is to browse the list of issues that are marked with the label\n[good first issue](https://github.com/goatshriek/stumpless/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).\nThese issues are selected to be a small but meaningful amount of work, and\ninclude details on the general approach that you can take to complete them. They\nare a great place to start if you are just looking to test the waters of this\nproject or open source contribution in general.\n\nMore experienced developers may prefer to look at the full list of issues on the\nproject, as well as the\n[roadmap](https://github.com/goatshriek/stumpless/blob/latest/docs/roadmap.md).\nIf an item catches your interest, drop a comment in the existing issue or open\na new one if it doesn't exist yet and state your intent to work on it so that\nothers will have a way to know it is underway.\n\n\n## Documentation and Community\nIf you're curious about how something in stumpless works that isn't explained\nhere, you can check the appropriate section of the documentation, stored in the\n[docs](https://github.com/goatshriek/stumpless/blob/latest/docs/) folder.\nFolders in the repository contain their own README files that detail what they\ncontain and any other relevant information. The documentation for each function\nis also hosted on the\n[project website](https://goatshriek.github.io/stumpless/), for both the C\nlibrary as well as the other language bindings like C++.\n\nStumpless also includes documentation in local installations in the form of\n`man` pages. Once you've installed the library, you can check the documentation\nfor any header file (and the functions it contains) by running man with the\nname of the header with directories replaced with underscores, for example\n`man stumpless_log.h` to see documentation for functions that log simple string\nmessages.\n\nThere are also plenty of ways that you can reach out to the project team and\nbroader community for support.\n * [Issues](https://github.com/goatshriek/stumpless/issues) and\n   [discussions](https://github.com/goatshriek/stumpless/discussions) on Github\n   are good ways to get a response if you have a specific question or\n   suggestion.\n * There is a persistent chat on [gitter](https://gitter.im/stumpless/community)\n   where you can find announcements and ask questions.\n * News about the project are typically announced on Twitter as well by\n   [goatshriek](https://twitter.com/goatshriek), using\n   [#StumplessLib](https://twitter.com/search?q=%23StumplessLib).\n * You can reach the primary maintainer via [email](mailto:joel@goatshriek.com)\n   if you want private communication. This is the preferred method for\n   [notifying](https://github.com/goatshriek/stumpless/blob/latest/docs/SECURITY.md#reporting-a-vulnerability)\n   us of security issues with the project, so that we can address them as\n   quickly as possible to reduce the risk of abuse.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoatshriek%2Fstumpless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoatshriek%2Fstumpless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoatshriek%2Fstumpless/lists"}