{"id":17054676,"url":"https://github.com/dominikwilkowski/log","last_synced_at":"2025-10-14T16:59:37.302Z","repository":{"id":30996032,"uuid":"126595524","full_name":"dominikwilkowski/log","owner":"dominikwilkowski","description":"No dependency better logging for your node app","archived":false,"fork":false,"pushed_at":"2023-03-04T04:07:03.000Z","size":1135,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"released","last_synced_at":"2025-09-28T01:25:19.224Z","etag":null,"topics":["ansi","ansi-colors","logging","logging-framework","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dominikwilkowski.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2018-03-24T12:07:36.000Z","updated_at":"2021-09-19T09:39:49.000Z","dependencies_parsed_at":"2025-04-12T17:18:46.791Z","dependency_job_id":null,"html_url":"https://github.com/dominikwilkowski/log","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/dominikwilkowski/log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominikwilkowski%2Flog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominikwilkowski%2Flog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominikwilkowski%2Flog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominikwilkowski%2Flog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dominikwilkowski","download_url":"https://codeload.github.com/dominikwilkowski/log/tar.gz/refs/heads/released","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominikwilkowski%2Flog/sbom","scorecard":{"id":351239,"data":{"date":"2025-08-11","repo":{"name":"github.com/dominikwilkowski/log","commit":"553e37f29ae401fba1365dc802c4215a58b12dbe"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'released'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T08:20:50.334Z","repository_id":30996032,"created_at":"2025-08-18T08:20:50.335Z","updated_at":"2025-08-18T08:20:50.335Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019610,"owners_count":26086760,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ansi","ansi-colors","logging","logging-framework","nodejs"],"created_at":"2024-10-14T10:15:28.033Z","updated_at":"2025-10-14T16:59:37.280Z","avatar_url":"https://github.com/dominikwilkowski.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"LOG [![Build Status](https://travis-ci.org/dominikwilkowski/log.svg?branch=released)](https://travis-ci.org/dominikwilkowski/log)\n===\n\n\u003e No dependency better logging for your node app\n\n![Log output](https://raw.githubusercontent.com/dominikwilkowski/log/released/assets/log.png)\n\n\n## Contents\n\n* [Install](#install)\n* [Use](#use)\n* [Customize](#customize)\n* [Settings](#settings)\n* [Tests](#tests)\n* [Release History](#release-history)\n* [License](#license)\n\n\n----------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n## Install\n\n\n```shell\nnpm install indent-log\n```\n\n\n**[⬆ back to top](#contents)**\n\n\n----------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n## Use\n\nRun the logger via:\n\n```js\nconst Log = require('indent-log');\n\nLog.banner( 'My app started' );\nLog.info( 'Server running at #', IPandPort );\n```\n\n\n### Vocabulary\n\nYou got a bunch of logs to chose from:\n\n```js\nLog.banner('Banner log');\nLog.ok('Ok log');\nLog.error('Error log');\nLog.info('Info log');\nLog.done('Done log');\nLog.verbose('Verbose log');\nLog.hr();\nLog.time('Time log');\n```\n\n![Log output](https://raw.githubusercontent.com/dominikwilkowski/log/released/assets/log7.png)\n\n`Log.hr()` will output a line that will fill the terminal and a line break before and after.\n\n\n### Variables\n\nYou can add variables by adding them as arguments. Each placeholder `#` will be replaced one by one with those variables. If you don’t have enough placeholder\nthe variables will be appended at the end:\n\n```js\nLog.info( 'running function in folder # to find #', 'folder', 'needle' );\n\nLog.info( 'running function in folder # to find #', 'folder' );\n\nLog.info( 'running function in folder # to find #', 'folder', 'needle', 42, [ 'one', 'two' ] );\n```\n\n![Log output](https://raw.githubusercontent.com/dominikwilkowski/log/released/assets/log2.png)\n\nAll variables are colored yellow to make reading easier.\n\n\n### Indentation\n\nLogs that run over the space you have in your terminal will automatically indent on the next line:\n\n```js\nLog.info('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ' +\n'ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation\\nullamco laboris ' +\n'nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit ' +\n'esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in ' +\n'culpa qui officia deserunt mollit anim id est laborum.');\n```\n\n![Log output](https://raw.githubusercontent.com/dominikwilkowski/log/released/assets/log3.png)\n\nThis can be disabled in the [`disableIndent`](#disableindent) setting.\n\n\n### Callbacks\n\nYou can register a callback for one or more log types.\n\n```js\nLog.callbacks.error = ( text, vars, type ) =\u003e DoSomething( text, vars, type );\n```\n\nNow every time you call `Log.error` the `DoSomething` function will also be run. This can be useful for error logging, notifications etc.\n\n\n**[⬆ back to top](#contents)**\n\n\n----------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n## Customize\n\nYou can extend the vocabulary of the log yourself by adding a flag and wrapping the `Log.Output` function:\n\n```js\nLog.flags.monkey = ' 🐒  monkey business: ';\n\nLog.monkey = ( text, ...vars ) =\u003e console.log( Log.Style.magenta( Log.Output( 'monkey', text, vars ) ) ),\n\nLog.banner('Monkey business starting now!');\nLog.monkey('Hey hey!!!');\n```\n\n![Log output](https://raw.githubusercontent.com/dominikwilkowski/log/released/assets/log4.png)\n\nRegistering a new flag will now ensure all other flags are indented to the largest flag unless it is disabled via the [`disableIndent`](#disableindent) setting.\n\n\n**[⬆ back to top](#contents)**\n\n\n----------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n## Settings\n\nYou can change the default settings via:\n\n```js\nLog.pretty = true;\n```\n\nAn example would be:\n\n```js\nconst Log = require('indent-log');\n\nif( process.argv.includes('-v') || process.argv.includes('--verbose') ) {\n\tLog.verboseMode = true;\n}\n```\n\n\n### `verboseMode`\n_(boolean)_  \ndefault: `false`\n\nToggle verbose output.\n\n\n### `verboseFilter`\n_(string)_  \ndefault: ``\n\nYou can filter the verbose output with this regex string. If you want to show only messages with the word `foo` then you’d use:\n\n```js\nLog.verboseFilter = 'foo';\n```\n\nIf you want to filter all messages that begin with `bar` you’d use:\n\n```js\nLog.verboseFilter = '^bar';\n```\n\nAn example script for your cli app would be:\n\n```js\nif( process.argv.includes('-v') || process.argv.includes('--verbose') ) {\n\tLog.verboseMode = true;\n\n\tconst flagParam = ( process.argv.indexOf('-v') !== -1 ? process.argv.indexOf('-v') : process.argv.indexOf('--verbose') ) + 1;\n\tconst verboseFilter = process.argv[ flagParam ] \u0026\u0026 process.argv[ flagParam ].startsWith('-') ? undefined : process.argv[ flagParam ];\n\n\tif( verboseFilter ) {\n\t\tLog.verboseFilter = verboseFilter;\n\t}\n}\n```\n\nNow the user can use your app with an optional filter like:\n\n```shell\nyourapp -v onlythisstring\n```\n\nAnd Log will filter by this word.\n\n\n### `disableIndent`\n_(array)_  \ndefault: `[ 'time' ]`\n\nAll messages are indented by the largest flag of all types. You can disable a particular type if that type has a very large flag that would make indentation\nof all other look ridicules. Below is what it looks like by default because the type `time` has it's indent disabled.\n\n```js\nLog.banner('Banner log');\nLog.ok('Ok log');\nLog.error('Error log');\nLog.info('Info log');\nLog.done('Done log');\nLog.verbose('Verbose log');\nLog.time('Time log');\n```\n\n![Log output](https://raw.githubusercontent.com/dominikwilkowski/log/released/assets/log5.png)\n\nThis is what it would look like if you enabled all indentation and included `time`:\n\n```js\nLog.disableIndent = [];\n\nLog.banner('Banner log');\nLog.ok('Ok log');\nLog.error('Error log');\nLog.info('Info log');\nLog.done('Done log');\nLog.verbose('Verbose log');\nLog.time('Time log');\n```\n\n![Log output](https://raw.githubusercontent.com/dominikwilkowski/log/released/assets/log6.png)\n\nEnabled:\n```\n🔔  INFO: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do \"var!\"\n          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim\n          veniam, quis nostrud exercitation.\n```\n\nDisabled:\n```\n🔔  INFO:\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do \"var!\" eiusmod tempor\nincididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud\nexercitation.\n```\n\n\n### `pretty`\n_(boolean)_  \ndefault: `false`\n\nEnable pretty printing of variables.\n\nEnabled:\n```\n🔥  ERROR: The cause:\n           {\"thing\":\"because\",\"more\":{\"evenmore\":[{\"reason\":\"buffer\"}]}}\n```\n\nDisabled:\n```\n🔥  ERROR: The cause:\n           {\n            \"thing\": \"because\",\n            \"more\": {\n             \"evenmore\": [\n              {\n               \"reason\": \"buffer\"\n              }\n             ]\n            }\n           }\n```\n\n\n### `flags`\n_(object)_\n\nThe flags are the strings shown in front of each message. The defaults are:\n\n```js\nLog.flags = {\n\tbanner: ` 📣  `,\n\terror: ` 🔥  ERROR: `,\n\tinfo: ` 🔔  INFO: `,\n\tok: ` 👍  `,\n\tdone: ` 🚀  DONE: `,\n\ttime: ` 🕐  [${ Log.Style.bold('#timestamp#') }]`,\n\tverbose: ` 😬  VERBOSE: `,\n};\n```\n\nThe string `#timestamp#` is replaced with the current timestamp.\n\nDo note that emojis in node have a very complex way of aligning in the character set. Make sure you either use them consistently or not at all. Calculating\nthe length of a string that contains emojis is difficult and would warrant a dependency like [grapheme-splitter](https://github.com/orling/grapheme-splitter).\nI am trying to keep this package dependency free though.\n\n\n### `callbacks`\n_(object)_\n\nThe callbacks are a collection of functions for each log. The defaults are empty:\n\n```js\nLog.callbacks = {\n\tbanner: void( 0 ),\n\terror: void( 0 ),\n\tinfo: void( 0 ),\n\tok: void( 0 ),\n\tdone: void( 0 ),\n\ttime: void( 0 ),\n\thr: void( 0 ),\n\tverbose: void( 0 ),\n};\n```\n\nIf you want the error log eg to do something special every time it’s run, this is where you can do that. Each function has the following parameter passed to it:\n\n```\n@param  {string} text - The message\n@param  {array}  vars - All variables passed to the message\n@param  {string} type - The type of message\n```\n\n\n**[⬆ back to top](#contents)**\n\n\n----------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n## Tests\n\nTo run the tests for this package run `npm test`. [Jest](https://facebook.github.io/jest/) will run unit tests.\nThere is also a `npm run test:watch` script that can be used while developing.\n\n\n**[⬆ back to top](#contents)**\n\n\n----------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n## Release History\n\nSee [CHANGELOG](https://raw.githubusercontent.com/dominikwilkowski/log/released/CHANGELOG.md).\n\n\n**[⬆ back to top](#contents)**\n\n\n----------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\n## License\n\nCopyright (c) Dominik Wilkowski.\nLicensed under [GNU-GPLv3](https://raw.githubusercontent.com/dominikwilkowski/log/released/LICENSE).\n\n\n**[⬆ back to top](#contents)**\n\n# };\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominikwilkowski%2Flog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdominikwilkowski%2Flog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominikwilkowski%2Flog/lists"}