{"id":21531992,"url":"https://github.com/o-holyshevskyi/test-logger","last_synced_at":"2026-05-17T21:02:54.201Z","repository":{"id":60081607,"uuid":"540495613","full_name":"o-holyshevskyi/test-logger","owner":"o-holyshevskyi","description":"Test Logger","archived":false,"fork":false,"pushed_at":"2022-09-24T20:44:18.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-14T07:12:47.836Z","etag":null,"topics":["automated-testing","automation","javascript","js","loggers","qa","qa-automation","test-logger","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tests-logger","language":"TypeScript","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/o-holyshevskyi.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":"2022-09-23T15:07:34.000Z","updated_at":"2022-11-30T07:42:15.000Z","dependencies_parsed_at":"2022-09-25T21:19:17.809Z","dependency_job_id":null,"html_url":"https://github.com/o-holyshevskyi/test-logger","commit_stats":null,"previous_names":["holyaleks/test-logger"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/o-holyshevskyi/test-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-holyshevskyi%2Ftest-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-holyshevskyi%2Ftest-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-holyshevskyi%2Ftest-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-holyshevskyi%2Ftest-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/o-holyshevskyi","download_url":"https://codeload.github.com/o-holyshevskyi/test-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o-holyshevskyi%2Ftest-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28332373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"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":["automated-testing","automation","javascript","js","loggers","qa","qa-automation","test-logger","typescript"],"created_at":"2024-11-24T02:18:28.151Z","updated_at":"2026-01-12T02:25:47.859Z","avatar_url":"https://github.com/o-holyshevskyi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test Logger\n\nTest logger tool is for easier logging your activity within the automated tests. For instance you need to log the tests steps in your test or some test logs (tracing, info or some errors without throwing), therefore this tool helps you do it more productively.\n\n# Installiation\n\n[![npm](https://img.shields.io/npm/v/tests-logger?style=flat-square)](https://www.npmjs.com/package/tests-logger) \n\nInstall `Test Logger` in your test project with the following command\n\n```\nnpm install test-logger\n```\n\nImport logger in your file\n\n```TypeScript\n// ./file.ts\nimport { Log } from 'test-logger'\n```\n# Logger types\n\nThis test logger has different types. Wich have mark of the type, date (dd/M/yyyy, hh:mm:ss.ms), and message you want to log.\nMore about them below:\n\n1. [STR] - Start. We can use this log to define the start of the test to easily find the beginning of the tests in your logs.\n\n```TypeScript\n// ./file.ts\nimport { Log } from 'test-logger';\n\nLog.startTest('The test starts here');\n\n// [STR]  24/9/2022, 15:38:18.731 --------------------------------------- The test starts here\n```\n\n2. [END] - End. We can use this log to define the end of the test to easily find the ending of the tests in your logs.\n\n```TypeScript\n// ./file.ts\nimport { Log } from 'test-logger';\n\nLog.endTest('The test ends here');\n\n// [END]  24/9/2022, 15:38:18.731 --------------------------------------- The test ends here\n```\n\n3. [TRC] - Trace. We can use this log to define the stack traces in your framework.\n\n```TypeScript\n// ./file.ts\nimport { Log } from 'test-logger';\n\nLog.stackTrace('Executing connection to the DB');\n\n// [TRC]  24/9/2022, 15:38:18.731 --------------------------------------- Executing connection to the DB\n```\n\n4. [INF] - Information. We can use this log to define the information about commands in your framework.\n\n```TypeScript\n// ./file.ts\nimport { Log } from 'test-logger';\n\nLog.info('Connection is successfully');\n\n// [INF]  24/9/2022, 15:38:18.731 --------------------------------------- Connection is successfully\n```\n\n5. [WRN] - Warning.\n\n```TypeScript\n// ./file.ts\nimport { Log } from 'test-logger';\n\nLog.warning(`Connection is successfully. Taken time: ${connectingTime}`);\n\n// [WRN]  24/9/2022, 15:38:18.731 --------------------------------------- Connection is successfully. Taken time: 0:8:64\n```\n\n6. [ERR] - Error.\n\n```TypeScript\n// ./file.ts\nimport { Log } from 'test-logger';\n\nLog.warning(`Connection is failed`);\n\n// [ERR]  24/9/2022, 15:38:18.731 --------------------------------------- Connection is failed\n```\n\n7. [STP] - Test steps.\n\n```TypeScript\n// ./file.ts\nimport { Log } from 'test-logger';\n\nLog.testStep(`Login to your account`);\n\n// [STP]  24/9/2022, 15:38:18.731 --------------------------------------- Login to your accoun\n```\n\n# Configuration\n\nYou may need to configure your logger for your approaches or goals. However you do not need to change everything. Therefore some configuration for this logger is described below\n\n## Log configuration\n\nBasically, this test logger is able to log information in two ways. The first one is show logged information in your console while running tests, the second one is to log information into `.log` file. Let's get review each of them\n\n### Console log\n\nFor this way you do not need an additional configuration. This logger shows your logs in the console by default with colored rows depends on log type (see below about color configuration)\n\n### File log\n\nIf you need to log test information in file, not in console and store it somewhere you need to change some configuration for this test logger. Let's create a file `loggerconfig.json` in the root directory of your project. Add the following code for this config file:\n\n```JSON\n{\n    \"report\": true\n}\n```\n\nWith the above config file test logs will be logged in the file `test-logs.log` in the root directory of your project. If you want to store this file in another place, you have to add `reportPath` parameter:\n\n```JSON\n{\n    \"report\": true,\n    \"reportPath\": \"/reports/test-logger-report.log\"\n}\n```\n\n## Color configuration\n\nBasically this test logger using default colors for logging test information in [different types](https://github.com/holyaleks/test-logger/edit/master/README.md#logger-types) for console\n\n### Basic color configuration\n\nStart and End logs in the console have green color ![#00FF00](https://via.placeholder.com/10/00FF00/00FF00.png):\n\n![image](https://user-images.githubusercontent.com/44750553/192115196-52a755da-87c1-4df5-92bc-a73e65391f73.png)\n![image](https://user-images.githubusercontent.com/44750553/192115186-952fb2cc-8a47-49d7-b767-77edabe88a05.png)\n\nTrace logs in the console have cyan color ![#00FFFF](https://via.placeholder.com/10/00FFFF/00FFFF.png):\n\n![image](https://user-images.githubusercontent.com/44750553/192115284-da132363-fc7d-4994-87db-0c726a48b883.png)\n\nInformation logs in the console have blue color ![#0000FF](https://via.placeholder.com/10/0000FF/0000FF.png):\n\n![image](https://user-images.githubusercontent.com/44750553/192115317-d38a9d80-f777-4c13-b1e7-538123ee02b7.png)\n\nWarning logs in the console have yelow color ![#FFFF00](https://via.placeholder.com/10/FFFF00/FFFF00.png):\n\n![image](https://user-images.githubusercontent.com/44750553/192115776-a542f871-5b49-4773-a172-4e17af10df76.png)\n\nError logs in the console have red color ![#FF0000](https://via.placeholder.com/10/FF0000/FF0000.png):\n\n![image](https://user-images.githubusercontent.com/44750553/192116147-537aaf2a-1a34-47ce-95d2-c3e6227f38c7.png)\n\nTest step logs in the console have magenta color ![#FF00FF](https://via.placeholder.com/10/FF00FF/FF00FF.png):\n\n![image](https://user-images.githubusercontent.com/44750553/192116199-377d22f3-c5df-4187-9a85-65e1036fc85e.png)\n\nIf you want to configure your own console colors, please use the `loggerconfig.json` file and add the following configuration for collors:\n\n```JSON\n{\n    \"report\": true,\n    \"reportPath\": \"/reports/test-logger-report.log\",\n    \"colors\": {\n        \"testStep\": \"FgWhite\"\n    }\n}\n```\n\nYou can find available colors or formats right here:\n\n```\nReset: \"\\x1b[0m\",\nBright: \"\\x1b[1m\",\nDim: \"\\x1b[2m\",\nUnderscore: \"\\x1b[4m\",\nBlink: \"\\x1b[5m\",\nReverse: \"\\x1b[7m\",\nHidden: \"\\x1b[8m\",\n\nFgBlack: \"\\x1b[30m\",\nFgRed: \"\\x1b[31m\",\nFgGreen: \"\\x1b[32m\",\nFgYellow: \"\\x1b[33m\",\nFgBlue: \"\\x1b[34m\",\nFgMagenta: \"\\x1b[35m\",\nFgCyan: \"\\x1b[36m\",\nFgWhite: \"\\x1b[37m\",\n\nBgBlack: \"\\x1b[40m\",\nBgRed: \"\\x1b[41m\",\nBgGreen: \"\\x1b[42m\",\nBgYellow: \"\\x1b[43m\",\nBgBlue: \"\\x1b[44m\",\nBgMagenta: \"\\x1b[45m\",\nBgCyan: \"\\x1b[46m\",\nBgWhite: \"\\x1b[47m\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo-holyshevskyi%2Ftest-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fo-holyshevskyi%2Ftest-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo-holyshevskyi%2Ftest-logger/lists"}