{"id":20263340,"url":"https://github.com/briandowns/nlog","last_synced_at":"2025-04-11T02:08:19.548Z","repository":{"id":81489591,"uuid":"159185848","full_name":"briandowns/nlog","owner":"briandowns","description":"Structured Logging for Nim","archived":false,"fork":false,"pushed_at":"2018-11-27T13:34:26.000Z","size":5,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T02:08:16.047Z","etag":null,"topics":["json","log","logger","nim","nim-lang","structured-logging"],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/briandowns.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":"2018-11-26T14:52:51.000Z","updated_at":"2021-06-06T07:41:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7fee19f-447e-4642-ab5d-e4e149bbbd38","html_url":"https://github.com/briandowns/nlog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briandowns%2Fnlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briandowns%2Fnlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briandowns%2Fnlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briandowns%2Fnlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/briandowns","download_url":"https://codeload.github.com/briandowns/nlog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328163,"owners_count":21085261,"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":["json","log","logger","nim","nim-lang","structured-logging"],"created_at":"2024-11-14T11:34:33.321Z","updated_at":"2025-04-11T02:08:19.540Z","avatar_url":"https://github.com/briandowns.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nlog\n\nnlog is a simple logging library that provides a JSON logger to be used in any kind of application. nlog can log to the console or a file.\n\n## Examples\n\nLog to the console:\n\n```nim\nlet logOpts: LogOpts = LogOpts(name: \"my_service\", output: stdout)\nlet log: Log = newLogger(logOpts)\n```\n\nLog to a file:\n\n```nim\nvar f: File = open(\"application.log\", fmWrite)\nlet logOpts: LogOpts = LogOpts(name: \"my_service\", output: f)\nlet log: Log = newLogger(logOpts)\nf.close()\n```\n\n```nim\nlog.info(\"this is the message\")\nlog.debug(\"this is the message too\", field(\"integer\", 7))\nlog.trace(\"this is also a message\", field(\"float\", 99.99))\nlog.error(\"something went horribly wrong\", field(\"definitely?\", true))\nlog.info(\"multiple fields\", field(\"field1\", \"value1\"), field(\"field2\", 2))\n```\n\nSample Output:\n\n```sh\n{\"timestamp\":1543325555.508735,\"level\":\"INFO\",\"env\":\"\",\"msg\":\"this is the message\"}\n{\"timestamp\":1543325555.508803,\"level\":\"DEBUG\",\"env\":\"\",\"msg\":\"this is the message\",\"integer\":7}\n{\"timestamp\":1543325555.508824,\"level\":\"TRACE\",\"env\":\"\",\"msg\":\"this is the message\",\"float\":99.98999999999999}\n{\"timestamp\":1543325555.508838,\"level\":\"ERROR\",\"env\":\"\",\"msg\":\"soemthing went horribly wrong\",\"bool\":true}\n{\"timestamp\":1543325555.508853,\"level\":\"INFO\",\"env\":\"\",\"msg\":\"multiple fields\",\"field1\":\"value1\",\"field2\":2}\n```\n\n## Contributing\n\nPlease feel free to open a PR!\n\n## License\n\nnlog source code is available under the BSD 3 clause [License](/LICENSE).\n\n## Contact\n\n[@bdowns328](http://twitter.com/bdowns328)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriandowns%2Fnlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbriandowns%2Fnlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriandowns%2Fnlog/lists"}