{"id":19142225,"url":"https://github.com/eldoy/rainlog","last_synced_at":"2026-05-19T03:19:01.907Z","repository":{"id":139868715,"uuid":"145506715","full_name":"eldoy/rainlog","owner":"eldoy","description":"Advanced command line logger with color support","archived":false,"fork":false,"pushed_at":"2021-02-21T19:42:49.000Z","size":269,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-01T02:16:03.248Z","etag":null,"topics":["color","file","format","logger","node","production","util"],"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/eldoy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-21T04:33:03.000Z","updated_at":"2022-06-04T21:52:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b806336-964f-4533-a167-252bd08250aa","html_url":"https://github.com/eldoy/rainlog","commit_stats":null,"previous_names":["fugroup/rainlog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eldoy/rainlog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Frainlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Frainlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Frainlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Frainlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldoy","download_url":"https://codeload.github.com/eldoy/rainlog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Frainlog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265227897,"owners_count":23731059,"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":["color","file","format","logger","node","production","util"],"created_at":"2024-11-09T07:26:23.432Z","updated_at":"2026-05-19T03:18:56.880Z","avatar_url":"https://github.com/eldoy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rainlog Node.js Logger\n\nThis versatile logger is an advanced ```console.log``` for your applications. It uses the built in ```util.format``` to make it easy to output strings and objects.\n\nYou can also log to file by setting it up in the configuration.\n\n### INSTALL\n```npm i rainlog```\n\n### USAGE\nBy default 2 loggers are included: *info* and *err*. You can add extra loggers as you please.\n```javascript\nconst Rainlog = require('rainlog')\nconst log = new Rainlog()\n\n// Write to console.log using the 'info' logger\nlog.info('hello world')\n\n// Write to console.log using the 'error' logger\nlog.err('hello world')\n\n// Update config for a single logger\nlog.get.err.set({ file: 'error.txt' })\n\n// Update config for all loggers\nlog.set({ quiet: true })\n\n// Reset config for a single logger\nlog.get.info.reset()\n\n// Reset config for all loggers\nlog.reset()\n\n// Write formatted text\nlog.info('%s %d %o', 'hello', 2020, { world: 'amazing' })\n// Output: hello 2020 { world: 'amazing' }\n\n// Use the $ function to write to file\nlog.$info('hello')\n\n// Add a logger to the existing log, pass name and config\n// The new logger is instantly available as 'log.warn'\nlog.add('warn', { quiet: true })\nlog.warn('this logger is on fire')\n\n// Create multiple logs if you want\naccess = new Rainlog()\naccess.info('user accessed')\naccess.err('user not found')\n```\n\n### FORMATTING\nHere are the formatting options, taken from the [Node.js docs](https://nodejs.org/api/util.html#util_util_format_format_args):\n```\n%s - String.\n%d - Number (integer or floating point value) or BigInt.\n%i - Integer or BigInt.\n%f - Floating point value.\n%j - JSON. Replaced with the string '[Circular]' if the argument contains circular references.\n%o - Object. A string representation of an object with generic JavaScript object formatting. Similar to util.inspect() with options { showHidden: true, showProxy: true }. This will show the full object including non-enumerable properties and proxies.\n%O - Object. A string representation of an object with generic JavaScript object formatting. Similar to util.inspect() without options. This will show the full object not including non-enumerable properties and proxies.\n%% - single percent sign ('%'). This does not consume an argument.\n```\n\n### CONFIGURATION\nUse the 'set' function to configure your logger. Files are not written to by default.\n```javascript\n// The default configuration looks like this for all loggers\n{\n  // When quiet is true there will be no output to console\n  quiet: process.env.NODE_ENV === 'production',\n\n  // Set the file option to a file name to also write to file\n  file: false,\n\n  // Set colors and modifers, see the 'chalk' module for options\n  style: 'green.bold.underline'\n}\n\n// Create the Rainlog instance\nconst log = new Rainlog()\n\n// Optionally pass the config to the constructor\nconst log = new Rainlog({ quiet: true })\n\n// Use the set function to configure your logger\nlog.get.info.set({ file: 'info.txt' })\nlog.get.err.set({ file: 'error.txt' })\n```\n\n### LICENSE\nMIT Licensed. Enjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Frainlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldoy%2Frainlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Frainlog/lists"}