{"id":18697692,"url":"https://github.com/federicoceratto/nim-nimlog","last_synced_at":"2026-02-07T08:32:02.952Z","repository":{"id":144890751,"uuid":"46890803","full_name":"FedericoCeratto/nim-nimlog","owner":"FedericoCeratto","description":"See","archived":false,"fork":false,"pushed_at":"2015-11-25T14:33:27.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T15:24:39.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/FedericoCeratto/nim-morelogging","language":"Nimrod","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FedericoCeratto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-25T22:22:19.000Z","updated_at":"2017-02-28T13:48:52.000Z","dependencies_parsed_at":"2023-04-14T05:23:33.392Z","dependency_job_id":null,"html_url":"https://github.com/FedericoCeratto/nim-nimlog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FedericoCeratto/nim-nimlog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoCeratto%2Fnim-nimlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoCeratto%2Fnim-nimlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoCeratto%2Fnim-nimlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoCeratto%2Fnim-nimlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FedericoCeratto","download_url":"https://codeload.github.com/FedericoCeratto/nim-nimlog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoCeratto%2Fnim-nimlog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29190191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-11-07T11:25:19.867Z","updated_at":"2026-02-07T08:32:02.927Z","avatar_url":"https://github.com/FedericoCeratto.png","language":"Nimrod","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nimlog\n\nNimlog is an advanced logging library for the [Nim language](http://nim-lang.org).\n\nIt supports *plain text* and **structured** logging with\n*multiple*, pluggable **writers** which can be **seperately filtered and formatted**.\n\n**Documentation is still lacking a lot of info. Will improve soon.**\n\n## Install\n\nNimlog is best installed with [Nimble](https://github.com/nim-lang/nimble), Nims package manager.\n\n```bash\nnimble install nimlog\n```\n\n## Getting started\n\nThis is a simple example showing how to use nimlog with the global logger.\n\nBy default, a global logger is setup up that will write to stdout with a simple format for debugging.\n\nYou can also retrieve a named sub-logger for a *facility*.\n\n```nim\nimport nimlog\n\n# Plain log message.\ninfo(\"Msg\")\n\n# Message with interpolation.\nerror(\"Msg $1 - $2\", 33, 55.55)\n\n# Log fields.\nlogFields((f1: \"x\", f2: 11)).warning(\"Msg\")\n\n# Facility.\nvar appLogger = getLogger(\"myfacility\")\n\n# Limit custom logger to messages of INFO and higher.\nappLogger.setSeverity(Severity.INFO)\n\nappLogger.critical(\"Msg $1\", [1, 2, 3])\nappLogger.withField(\"x\", 55).debug(\"Msg\") # Will be ignored, since severity is set to INFO.\nappLogger.withFields((a: 1, b: \"x\")).info(\"msg\")\n\n# Nested logger.\nappLogger.getLogger(\"subfacility\").warning(\"Warn\")\n```\n\n## Concepts\n\nThis section explains how nimlog is structured, and how you can customize it.\n\nYou can create an arbitrary amount of **nested, named loggers**.\n\nEach logger has a *facility*, which is just a string name. \nThis usually corresponds to specific parts of your program.\n\nEach log message has a **severity**.\nBy default, the syslog severities are supported (see additional information).\nBut you can register your own, **custom severities**.\n\nEach logger can have multiple **formatters**, which transform the log message.\nThey can add fields, change the log message, or even change the severity.\n\nEach logger can have multiple **filters**, which decide whether the log message should be ignored.\n\nEach logger can have multiple **writers**, which handle the log entry. \nIncluded writers are: \n* NilWriter: discards all messages, useful for stubbing.\n* FileWriter: writes to files, also used for stdout.\n* SocketWriter:  sends structured log data to log aggregators like graylog.\n* ChannelWriter: allows to use any other writer in a **thread-safe** manner.\n\n\nEach **writer** can again have **it's own** **filters** and **formatters**.\n\n### Log Entry\n\nLog entries are represented as an object.\nFormatters and writers receive that object and can handle it as they whish.\n\n```nim\nEntry* = object\n  facility*: string\n  severity*: Severity\n  customSeverity*: string\n  time*: times.TimeInfo\n  msg*: string\n  fields*: ValueMap\n```\n\n\n## Additional Information\n\n### Log levels\n\nBy default, nimlog supports the log severities specified in the syslog RFC [syslog](http://tools.ietf.org/html/rfc5424).\nYou can also configure *custom levels*.\n\n| Severity  | Numerical value |\n| --------- | --------------- |\n| emergency | 1 |\n| alert     | 2 |\n| critical  | 3 |\n| error     | 4 |\n| warning   | 5 |\n| notice    | 6 |\n| info      | 7 |\n| debug     | 8 |\n| custom    | 9 |\n\n\n### Time format\n\nWhile you may change the time format used, it is highly recommended to stick to the default specified by [RFC3339](http://tools.ietf.org/htmlrfc3339).\n\n### Todo\n\n- [ ] More tests.\n- [ ] Finish writing documentation.\n- [ ] Thread-safe memory writer.\n- [ ] Rolling file writer.\n\n### Versioning\n\nThis project follows [SemVer](semver.org).\n\n### License.\n\nThis project is under the [LGPL 3](http://www.gnu.org/licenses/lgpl-3.0.en.html) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericoceratto%2Fnim-nimlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedericoceratto%2Fnim-nimlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericoceratto%2Fnim-nimlog/lists"}