{"id":15550568,"url":"https://github.com/tolga1452/logchu","last_synced_at":"2025-03-22T18:33:14.878Z","repository":{"id":176618284,"uuid":"659304516","full_name":"Tolga1452/logchu","owner":"Tolga1452","description":"Very simple and cool logger for your Node.js projects. Supports JavaScript and TypeScript.","archived":false,"fork":false,"pushed_at":"2024-07-18T20:57:53.000Z","size":289,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-15T14:24:49.696Z","etag":null,"topics":["color","customize","javascript","js","library","log","module","npm","package","ts","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@tolga1452/logchu/v/latest","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tolga1452.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":["Tolga1452"]}},"created_at":"2023-06-27T14:45:48.000Z","updated_at":"2024-07-30T08:18:48.000Z","dependencies_parsed_at":"2024-07-19T02:09:35.101Z","dependency_job_id":"fad6a487-b49c-4091-a2a1-1bba36faab4f","html_url":"https://github.com/Tolga1452/logchu","commit_stats":null,"previous_names":["tolga1452/logchu"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tolga1452%2Flogchu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tolga1452%2Flogchu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tolga1452%2Flogchu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tolga1452%2Flogchu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tolga1452","download_url":"https://codeload.github.com/Tolga1452/logchu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221832247,"owners_count":16888203,"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","customize","javascript","js","library","log","module","npm","package","ts","typescript"],"created_at":"2024-10-02T13:59:56.096Z","updated_at":"2024-10-28T13:31:32.057Z","avatar_url":"https://github.com/Tolga1452.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Tolga1452"],"categories":[],"sub_categories":[],"readme":"# logchu\n\nVery simple and cool logger for your [Node.js](https://nodejs.org/) projects. Supports JavaScript and TypeScript.\n\n## Features\n\n| Feature |\n| --- |\n| ✅ Fully customizable |\n| ✅ Basic logging |\n| ✅ Chalk support |\n| ✅ RGB, ANSI, Decimal, Hexadecimal support |\n| ✅ JavaScript \u0026 TypeScript support |\n| ✅ Advanced logging |\n| ✅ Log level support |\n| ✅ Custom colors |\n| ✅ Custom loggers |\n| ✅ Randomized logging |\n| ✅ Rainbow logging |\n| ✅ Config file support |\n| ✅ Built-in colors |\n| ✅ Custom logger logic support |\n| ✅ Log file support |\n| ✅ Log event support |\n\n## Installation\n\n```bash\nnpm install @tolga1452/logchu\n```\n\n## Usage\n\n```js\nconst { logger, ColorPreset, fromChalk, LogType } = require('@tolga1452/logchu');\n\n// Basic usage\nlogger.info('Hello, world!');\nlogger.success('Hello, world!');\nlogger.warning('Hello, world!');\nlogger.error('Hello, world!');\nlogger.debug('Hello, world!');\n\n// With styles and color presets\nlogger.info('Hello, world!', { bold: true });\nlogger.custom('Hello, world!', { color: ColorPreset.Magenta, italic: true, type: LogType.Debug });\nlogger.custom('Hello, world!', ColorPreset.Cyan);\n\n// With chalk\nconst chalk = require('chalk');\n\nlogger.custom('Hello, world!', fromChalk(chalk.dim.red(' '))); // You have to use a single space character as text for chalk\n```\n\n## Randomization\n\n```js\nconst { logger } = require('@tolga1452/logchu');\n\nlogger.random('Hello, world!', { bold: true }); // Log with random color\nlogger.fullRandom('Hello, world!', { inverse: true }); // Fully random log with overwrites\n```\n\n## Advanced Logs\n\n### `write` Methd\n\n```js\nconst { write, ColorPreset } = require('@tolga1452/logchu');\n\nwrite(\n    {\n        color: ColorPreset.LightGray,\n        italic: true\n    },\n    {\n        text: 'First one was default config ',\n        color: ColorPreset.LightGreen\n    },\n    {\n        text: 'this is ',\n        useDefault: true\n    },\n    {\n        text: 'awesome!',\n        color: ColorPreset.LightCyan,\n        bold: true\n    }\n);\n```\n\n### Custom Logger Logic\n\n```js\nconst { CustomLogger } = require('@tolga1452/logchu');\n\nconst myCustomLogger = new CustomLogger({\n    _logic: log =\u003e {\n        console.log('Put your custom logic here.');\n        console.log('This will be runned along with the default logic.');\n    },\n    info: { color: ColorPreset.BackgroundBlue, italic: true }\n}, true); // true for overwrite default logic\n```\n\n## Custom Colors\n\nSupports Hexadecimal, RGB, decimal and ANSI colors.\n\n### In Your Code\n\n```js\nconst { logger } = require('@tolga1452/logchu');\n\nlogger.custom('Hello, world!', { color: '#f44747' });\n```\n\n### From Config File\n\n1. Create a file named `logchu.config.js` in your project root.\n2. Add the following code to the file:\n\n```js\nmodule.exports = {\n    customColorPresets: {\n        myCustomColor: '#639dff'\n    }\n};\n```\n\n3. Use it in your code:\n\n```js\nconst { logger, userColor } = require('@tolga1452/logchu');\n\nlogger.custom('Hello, world!', userColor('myCustomColor'));\n```\n\n## Custom Loggers\n\n### In Your Code\n\n```js\nconst { CustomLogger, ColorPreset } = require('@tolga1452/logchu');\n\nconst myCustomLogger = new CustomLogger({\n    info: { color: ColorPreset.BackgroundBlue, italic: true },\n    success: { color: ColorPreset.LightGreen, bold: true },\n    trolley: { color: '#9b4eea', bold: true }\n});\n\nmyCustomLogger.info('Hello, world!');\nmyCustomLogger.success('Hello, world!', { bold: false });\nmyCustomLogger.trolley('Hello, world!', ColorPreset.BackgroundRed);\n```\n\n### From Config File\n\n1. Create a file named `logchu.config.js` in your project root.\n2. Add the following code to the file:\n\n```js\nconst { ColorPreset } = require('@tolga1452/logchu');\n\nmodule.exports = {\n    customLoggers: {\n        myCustomLogger: {\n            info: { color: ColorPreset.BackgroundBlue, italic: true },\n            success: { color: '#80b918', bold: true },\n            trolley: { color: '$custom:myCustomColor', bold: true }\n        }\n    },\n    customColorPresets: {\n        myCustomColor: '#e84118'\n    }\n};\n```\n\n3. Use it in your code:\n\n```js\nconst { useLogger } = require('@tolga1452/logchu');\n\nconst myCustomLogger = useLogger('myCustomLogger');\n\nmyCustomLogger.info('Hello, world!');\n```\n\n## Saving Logs\n\n1. Create a file named `logchu.config.js` in your project root.\n2. Add the following code to the file:\n\n```js\nmodule.exports = {\n    logFile: './logs.txt'\n};\n```\n\n## Log Events\n\n1. Create a file named `logchu.config.js` in your project root.\n2. Add the following code to the file:\n\n```js\nconst { Watcher } = require('@tolga1452/logchu');\n\nmodule.exports = {\n    watcher: new Watcher()\n};\n```\n\n3. Use it in your code:\n\n```js\nconst { logger, LogEvent } = require('@tolga1452/logchu');\nconst { watcher } = require('./logchu.config');\n\nwatcher.on(LogEvent.Info, log =\u003e {\n    console.log('Info log event triggered:', log);\n});\n\nlogger.info('Hello, world!');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolga1452%2Flogchu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftolga1452%2Flogchu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolga1452%2Flogchu/lists"}