{"id":22300667,"url":"https://github.com/thenorthsolution/prtyprnt","last_synced_at":"2025-03-25T23:28:41.562Z","repository":{"id":251372952,"uuid":"836237879","full_name":"thenorthsolution/prtyprnt","owner":"thenorthsolution","description":"A pretty Node.js logger","archived":false,"fork":false,"pushed_at":"2024-08-02T09:07:54.000Z","size":107,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T20:43:36.228Z","etag":null,"topics":["console","logger","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/thenorthsolution.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":"2024-07-31T12:36:47.000Z","updated_at":"2024-08-02T12:32:42.000Z","dependencies_parsed_at":"2024-08-02T15:27:29.682Z","dependency_job_id":null,"html_url":"https://github.com/thenorthsolution/prtyprnt","commit_stats":null,"previous_names":["thenorthsolution/prtyprnt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenorthsolution%2Fprtyprnt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenorthsolution%2Fprtyprnt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenorthsolution%2Fprtyprnt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenorthsolution%2Fprtyprnt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thenorthsolution","download_url":"https://codeload.github.com/thenorthsolution/prtyprnt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245559234,"owners_count":20635323,"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":["console","logger","nodejs"],"created_at":"2024-12-03T18:13:04.740Z","updated_at":"2025-03-25T23:28:36.546Z","avatar_url":"https://github.com/thenorthsolution.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prtyprnt\n\nA Node.js logging library\n\n## Installation\n\n```bash\nnpm install prtyprnt\n```\n\n## Usage\n\n```js\n// Default instance usage\nimport { logger } from 'prtyprnt';\n\nlogger.info('Hello, World!');\nlogger.debug('Hello, World!');\nlogger.warn('Hello, World!');\nlogger.error('Hello, World!');\nlogger.fatal('Hello, World!');\n```\n\n```js\n// Custom instance usage\nimport { logger as defaultLogger, Logger, FileWriteStreamMode, Formatter } from 'prtyprnt';\n\nconst logger = new Logger({\n    formatter: new Formatter(), // Formatter of log messages for console and write stream\n    parent: defaultLogger, // Parent logger, events will also be emitted to this logger\n    label: 'MyLogger', // Label of the logger\n    debugmode: {\n        enabled: true, // Enable debug mode\n        printMessage: true, // Print debug messages to console\n        writeToFile: true // Write debug messages to a file\n    },\n    writeStream: await Logger.createFileWriteStream({\n        mode: FileWriteStreamMode.Rename, // Mode when dealing with old log file\n        filename: './logs/latest.log', // Filename of the log file\n        renameFile: Utils.gzipCompressLog // Function to rename the log file\n    }), // Write stream to log to a file\n    objectInspectOptions: { colors: true } // Object inspect options\n})\n\nlogger.info('Hello, World!');\nlogger.debug('Hello, World!');\nlogger.warn('Hello, World!');\nlogger.error('Hello, World!');\nlogger.fatal('Hello, World!');\n```\n\n```js\n// Clone instance usage\nconst newLogger = logger.clone({\n    label: 'MyNewLogger'\n});\n\nnewLogger.info('Hello, World!');\nnewLogger.debug('Hello, World!');\nnewLogger.warn('Hello, World!');\nnewLogger.error('Hello, World!');\nnewLogger.fatal('Hello, World!');\n```\n\n```js\n// Log to a file\nimport { logger, FileWriteStreamModem, Utils } from 'prtyprnt';\n\nawait logger.createFileWriteStream({\n    mode: FileWriteStreamMode.Rename,\n    filename: './logs/latest.log',\n    renameFile: Utils.gzipCompressLog\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenorthsolution%2Fprtyprnt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthenorthsolution%2Fprtyprnt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenorthsolution%2Fprtyprnt/lists"}