{"id":22567999,"url":"https://github.com/titarenko/totlog","last_synced_at":"2025-04-10T12:25:40.280Z","repository":{"id":57378293,"uuid":"44973789","full_name":"titarenko/totlog","owner":"titarenko","description":"The only true log","archived":false,"fork":false,"pushed_at":"2024-10-17T07:19:11.000Z","size":98,"stargazers_count":4,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T11:12:17.019Z","etag":null,"topics":["categories","category","color","colors","log","logger","logging","logstash","slack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/titarenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-26T14:29:56.000Z","updated_at":"2024-10-17T07:19:16.000Z","dependencies_parsed_at":"2022-09-26T16:41:25.335Z","dependency_job_id":null,"html_url":"https://github.com/titarenko/totlog","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/titarenko%2Ftotlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titarenko%2Ftotlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titarenko%2Ftotlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titarenko%2Ftotlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/titarenko","download_url":"https://codeload.github.com/titarenko/totlog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217114,"owners_count":21066633,"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":["categories","category","color","colors","log","logger","logging","logstash","slack"],"created_at":"2024-12-08T00:10:48.189Z","updated_at":"2025-04-10T12:25:40.259Z","avatar_url":"https://github.com/titarenko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# totlog\n\nThe only true log: zero dependencies, categories, colors, events for flexible support of additional appending logic. Bonus: slack and logstash appenders. Extra bonus: (almost) everything is tested.\n\n[![Build Status](https://travis-ci.org/titarenko/totlog.svg?branch=master)](https://travis-ci.org/titarenko/totlog)\n[![Coverage Status](https://coveralls.io/repos/github/titarenko/totlog/badge.svg?branch=master)](https://coveralls.io/github/titarenko/totlog?branch=master)\n\n## How to use\n\n`mymodule.js`\n```js\nconst log = require('totlog')(__filename)\nlog.debug('anything that %s could pass to %s', 'you', 'util.format')\n// will output colored content to console with\n// - time\n// - category = module filename relative to project root folder\n// - level\n// - formatted message\n```\n\n## Advanced\n\n`log.js`\n```js\nconst log = require('totlog')\nmodule.exports = log\nconst slack = log.appenders.slack({ token: 'chpoken', channel: 'alerts', icon: ':hideyourpain:' })\nlog.on('message', message =\u003e {\n\tif (message.level == 'error') {\n\t\tslack(message)\n\t}\n})\n// notice how easy it is to define custom appending logic\n// everything you need is JS knowledge\n// without experiencing complex and/or obscure APIs\n```\n\n`mymodule.js`\n```js\nconst log = require('./log')(__filename)\nlog.error('anything that %s could pass to %s', 'you', 'util.format')\n// message will appear both in console and in slack\n```\n\n## Appenders\n\n### Slack\n\n```js\nconst slack = log.appenders.slack({ token, channel, icon })\nconst logstashTcp = log.appenders.logstash('tcp://host:port')\nconst logstashUdp = log.appenders.logstash('udp://host:port')\n```\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftitarenko%2Ftotlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftitarenko%2Ftotlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftitarenko%2Ftotlog/lists"}