{"id":17137408,"url":"https://github.com/easingthemes/logdc","last_synced_at":"2026-05-19T04:32:18.429Z","repository":{"id":75134517,"uuid":"102158786","full_name":"easingthemes/logdc","owner":"easingthemes","description":"Simple console log for NodeJs with colors and datestamp","archived":false,"fork":false,"pushed_at":"2017-09-18T22:43:00.000Z","size":406,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-11T23:42:52.525Z","etag":null,"topics":["nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/easingthemes.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":"2017-09-01T22:56:09.000Z","updated_at":"2017-09-05T15:57:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"e37647dc-9c8a-4929-b8d3-1ed91df1214d","html_url":"https://github.com/easingthemes/logdc","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.03125,"last_synced_commit":"c7b2050df7f36c1fcf53242510d080a4f9abab20"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/easingthemes/logdc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easingthemes%2Flogdc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easingthemes%2Flogdc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easingthemes%2Flogdc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easingthemes%2Flogdc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/easingthemes","download_url":"https://codeload.github.com/easingthemes/logdc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easingthemes%2Flogdc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265506134,"owners_count":23778662,"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":["nodejs"],"created_at":"2024-10-14T20:06:58.577Z","updated_at":"2026-05-19T04:32:13.379Z","avatar_url":"https://github.com/easingthemes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logdc\nSimple console log for NodeJs with colors and timestamp.\n0 dependencies.\n\n![Logdc example](/logdc-intro.png?raw=true \"Examples\")\n\n\n## Installation\n\n```\n$ npm install logdc\n```\n\n```\n$ yarn add logdc\n```\n\n## Usage\n\n```\nconst log = require(logdc);\n\nlog.info('Lorem Ipsum', {foo: ['bar']}, [1, 2, 3], 'Dolorem');\n$[19:15:46] INFO    : 'Lorem Ipsum', { foo: [ 'bar' ] }, [ 1, 2, 3 ], 'Dolorem'\n```\n\n## Types (Default)\n\n```\n// code\nlog.info('Lorem Ipsum');\nlog.warn('Lorem Ipsum');\nlog.error('Lorem Ipsum');\nlog.success('Lorem Ipsum');\nlog.log('Lorem Ipsum');\nlog.br();\n// console:\n\n$[19:15:46] INFO    : 'Lorem Ipsum'\n$[19:15:46] WARN    : 'Lorem Ipsum'\n$[19:15:46] ERROR   : 'Lorem Ipsum'\n$[19:15:46] SUCCESS : 'Lorem Ipsum'\n$[19:15:46] LOG     : 'Lorem Ipsum'\n$[19:15:46] ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: \n```\n\n## Separator\n\n```\nlog.br();\n$[19:15:46] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n```\n\nTo change separator character override default settings for label `br`.\n\n## Settings\n\nOverride default settings or create new labels in your `package.json` file.\n\nAdd `logdcConfig` node:\n\n```\n  \"logdcConfig\": {\n    \"labels\": {\n      \"foo\": {\n        \"color\": \"red\",\n        \"text\": \"My Custom label\"\n      },\n      \"warn\": {\n        \"color\": \"green\",\n        \"text\": \"Do not warn me!\"\n      }\n    },\n    \"time\": true,\n    \"counter\": 2,\n    \"equal\": true\n  }\n```\n\n#### 1. Labels\n\n 1.1. Hide labels\n\n```\n  \"logdcConfig\": {\n    \"labels\": false\n  }\n```\n\n```\nlog.info('Lorem Ipsum');\n\n$[19:19:25] 'Lorem Ipsum'\n\n```\n\n 1.2. Add custom labels, or override default\n```\n\"logdcConfig\": {\n    \"labels\": {\n        \"foo\": {\n            \"color\": \"red\",\n            \"text\": \"My Custom label\"\n        },\n        \"warn\": {\n            \"color\": \"green\",\n            \"text\": \"Do not warn me!\"\n        }\n    }\n}\n```\n \n```\nlog.foo('Lorem Ipsum');\n$[19:15:46] FOO     : 'Lorem Ipsum'\n\nlog.warn('Lorem Ipsum');\n$[19:15:46] DO NOT WARN ME! : 'Lorem Ipsum'\n```\n\n 1.3. Equal length\n\nLength of labels (type name + spaces + ':') is equal to longest type name (default 8 `SUCCESS :`),\nso that colon is always at the same vertical position. To disable this behaviour set `equal` as `false`\n\n```\n\"logdcConfig\": {\n    \"equal\": false\n}\n```\n\n```\nlog.info('Lorem Ipsum');\nlog.error('Lorem Ipsum');\n// console\n$[19:15:46] INFO: 'Lorem Ipsum'\n$[19:15:46] ERROR: 'Lorem Ipsum'\n```\n\n#### 2. Time\n\nTo hide timestamp set `time` to `false`\n\n```\n\"logdcConfig\": {\n    \"time\": false\n}\n```\n\n```\nlog.info('Lorem Ipsum');\n$INFO    : 'Lorem Ipsum'\n```\n\n#### 3. Colors\n\nLabel name has color.\n\nConfig `counter` is defining number of logged arguments to colorize, default is 2, or colorize label and first argument.\n\n 3.1. To disable colors pass set `counter` as `0`\n\n```\n\"logdcConfig\": {\n    \"counter\": 0\n}\n```\n\n```\nlog.info('Lorem Ipsum');\n$[19:15:46] INFO    : 'Lorem Ipsum'\n```\n\n 3.2. To add colors to other logged parameters increase `counter` (`1` is for label)\n\n```\n\"logdcConfig\": {\n    \"counter\": 4\n}\n```\n\n```\nlog.info('Lorem Ipsum', {foo: 'bar'}, 'Third param');\n$[19:15:46] INFO    : 'Lorem Ipsum', { foo: 'bar' }, 'Third param'\n```\n\n 3.3. To change color of default label set `labels` with default type as key:\n \n ```\n \"logdcConfig\": {\n     \"labels\": {\n         \"error\": {\n             \"color\": \"white\",\n             \"text\": \"No errors\"\n         },\n         \"warn\": {\n             \"color\": \"green\",\n             \"text\": \"Do not warn me!\"\n         }\n     }\n }\n ```\n\n```\nlog.error('Lorem Ipsum');\n$[19:15:46] NO ERRORS : 'Lorem Ipsum'\n```\n\n## Default arguments\n\n```\n  \"logdcConfig\": {\n    \"labels\": {\n        \"log\": {\n            \"color\": \"white\",\n            \"text\": \"log\"\n        },\n        \"info\":    {\n            \"color\": \"white\",\n            \"text\": \"info\"\n        },\n        \"warn\":    {\n            \"color\": \"yellow\",\n            \"text\": \"warning\"\n        },\n        \"error\":   {\n            \"color\": \"red\",\n            \"text\": \"error\"\n        },\n        \"success\": {\n            \"color\": \"green\",\n            \"text\": \"success\"\n        },\n        \"br\":      {\n            \"color: \"white\",\n            \"text\": \":\"\n        }\n    },\n    \"time\": true,\n    \"counter\": 2,\n    \"equal\": true\n  }\n```\n\n## Examples\n\n![Logdc examples](/logdc.png?raw=true \"Examples\")\n\n```\nlog.info('Lorem Ipsum', {foo: ['bar']}, [1, 2, 3], 'Dolorem')\n$[17:03:26] INFO    : 'Lorem Ipsum', { foo: [ 'bar' ] }, [ 1, 2, 3 ], 'Dolorem'\n```\n\n```\nlog.warn('Lorem Ipsum', {foo: ['bar']}, [1, 2, 3], 'Dolorem')\n$[17:03:26] WARN    : 'Lorem Ipsum', { foo: [ 'bar' ] }, [ 1, 2, 3 ], 'Dolorem'\n```\n\n```\nlog.error('Lorem Ipsum', {foo: ['bar']}, [1, 2, 3], 'Dolorem')\n$[17:03:26] ERROR   : 'Lorem Ipsum', { foo: [ 'bar' ] }, [ 1, 2, 3 ], 'Dolorem'\n```\n\n```\nlog.success('Lorem Ipsum', {foo: ['bar']}, [1, 2, 3], 'Dolorem')\n$[17:03:26] SUCCESS : 'Lorem Ipsum', { foo: [ 'bar' ] }, [ 1, 2, 3 ], 'Dolorem'\n```\n\n```\nlog.log('Lorem Ipsum', {foo: ['bar']}, [1, 2, 3], 'Dolorem')\n$[17:03:26] LOG     : 'Lorem Ipsum', { foo: [ 'bar' ] }, [ 1, 2, 3 ], 'Dolorem'\n```\n\n```\nlog.br()\n$[17:03:26] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasingthemes%2Flogdc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasingthemes%2Flogdc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasingthemes%2Flogdc/lists"}