{"_id":"@alexandru_david/tslog","_rev":"4-6b928e4215561f4efc355a50dcb4be6d","name":"@alexandru_david/tslog","dist-tags":{"latest":"3.2.4"},"versions":{"3.2.2":{"name":"@alexandru_david/tslog","version":"3.2.2","description":"📝 Expressive TypeScript Logger for Node.js: Pretty errors, stack traces, code frames, and JSON output to attachable transports.","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/types/index.d.ts","engines":{"node":">=10"},"scripts":{"ts-node":"ts-node example/index.ts","ts-node-onchange":"onchange -i \"**/*.ts\" -- npm run ts-node","start-ts":"npm run ts-node","start":"node dist/example/index.js","build":"tsc -b tsconfig.json tsconfig.esm.json tsconfig.types.json","prepublishOnly":"npm run build && npm run test","eslint":"eslint . --ext .ts","eslint-fix":"eslint . --ext .ts --fix","test":"jest","coveralls":"jest --coverage && coveralls < coverage/lcov.info","docsify-init":"docsify init ./docs","docsify-serve":"cd docs && docsify serve","api-extractor":"tsc && mkdir -p ./docs/api_extractor && api-extractor run --local --verbose","typedoc":"typedoc","generate-all-docs":"npm run api-extractor && typedoc","release":"np"},"jest":{"verbose":true,"preset":"ts-jest","testEnvironment":"node","collectCoverage":true,"testMatch":["/**/*.test.ts","/**/node_modules_test/*.test.ts"]},"np":{"yarn":false,"contents":"."},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fullstack-build/tslog.git"},"authors":["Eugene Terehov <eugene@fullstack.build>"],"license":"MIT","bugs":{"url":"https://github.com/fullstack-build/tslog/issues"},"homepage":"https://tslog.js.org","devDependencies":{"@microsoft/api-extractor":"^7.18.5","@rushstack/eslint-config":"^2.4.0","@types/jest":"^27.0.1","@types/node":"^14.17.9","@types/source-map-support":"^0.5.4","@typescript-eslint/types":"^4.29.1","coveralls":"^3.1.1","docsify":"^4.12.1","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","git-hooks":"^1.1.10","jest":"^27.0.6","np":"^7.5.0","onchange":"^7.1.0","prettier":"^2.3.2","ts-jest":"^27.0.4","ts-node":"^10.2.0","typedoc":"^0.21.5","typescript":"^4.3.5"},"dependencies":{"source-map-support":"^0.5.19"},"sideEffects":false,"keywords":["logger","typescript","log level","json","stacktrace","Error.stack","call location","debug","pretty","log","log4j","log4js","log4ts","print","logging","bunyan","winston","stack","trace","pretty print","prettify","format","human","callsites","callsite","show error","handling exceptions","pretty log","pretty json","pretty-error","sourcemap"],"gitHead":"7cea664c6fc0cd1c2f00b08b9779229a12bf92d2","_id":"@alexandru_david/tslog@3.2.2","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-jL7hZzVbbuJM8Yp9nKjpFnlzO5nHMWdID1i+72aFQicS8hY0/g28Li0smQF8Xx/fcuBc7F4lLAIRzJ5gjw8SBQ==","shasum":"703620afc1dc5c560ac914760129a0921920a9e7","tarball":"https://registry.npmjs.org/@alexandru_david/tslog/-/tslog-3.2.2.tgz","fileCount":46,"unpackedSize":267990,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQRBakqdtc0ZhqPBj+8PrsfpQ08VLtizG73fZQ9Rm3VAiEAjMm/d+JggtSRNjlQmRBa5InaSocsEyujioT070c9BJQ="}]},"_npmUser":{"name":"alexandru_david","email":"alexandru.david@hotmail.com"},"directories":{},"maintainers":[{"name":"alexandru_david","email":"alexandru.david@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tslog_3.2.2_1636635368702_0.09998793421127816"},"_hasShrinkwrap":false},"3.2.3":{"name":"@alexandru_david/tslog","version":"3.2.3","description":"📝 Expressive TypeScript Logger for Node.js: Pretty errors, stack traces, code frames, and JSON output to attachable transports.","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/types/index.d.ts","engines":{"node":">=10"},"scripts":{"ts-node":"ts-node example/index.ts","ts-node-onchange":"onchange -i \"**/*.ts\" -- npm run ts-node","start-ts":"npm run ts-node","start":"node dist/example/index.js","build":"tsc -b tsconfig.json tsconfig.esm.json tsconfig.types.json","prepublishOnly":"npm run build && npm run test","eslint":"eslint . --ext .ts","eslint-fix":"eslint . --ext .ts --fix","test":"jest","coveralls":"jest --coverage && coveralls < coverage/lcov.info","docsify-init":"docsify init ./docs","docsify-serve":"cd docs && docsify serve","api-extractor":"tsc && mkdir -p ./docs/api_extractor && api-extractor run --local --verbose","typedoc":"typedoc","generate-all-docs":"npm run api-extractor && typedoc","release":"np"},"jest":{"verbose":true,"preset":"ts-jest","testEnvironment":"node","collectCoverage":true,"testMatch":["/**/*.test.ts","/**/node_modules_test/*.test.ts"]},"np":{"yarn":false,"contents":"."},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fullstack-build/tslog.git"},"authors":["Eugene Terehov <eugene@fullstack.build>"],"license":"MIT","bugs":{"url":"https://github.com/fullstack-build/tslog/issues"},"homepage":"https://tslog.js.org","devDependencies":{"@microsoft/api-extractor":"^7.18.5","@rushstack/eslint-config":"^2.4.0","@types/jest":"^27.0.1","@types/node":"^14.17.9","@types/source-map-support":"^0.5.4","@typescript-eslint/types":"^4.29.1","coveralls":"^3.1.1","docsify":"^4.12.1","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","git-hooks":"^1.1.10","jest":"^27.0.6","np":"^7.5.0","onchange":"^7.1.0","prettier":"^2.3.2","ts-jest":"^27.0.4","ts-node":"^10.2.0","typedoc":"^0.21.5","typescript":"^4.3.5"},"dependencies":{"source-map-support":"^0.5.19"},"sideEffects":false,"keywords":["logger","typescript","log level","json","stacktrace","Error.stack","call location","debug","pretty","log","log4j","log4js","log4ts","print","logging","bunyan","winston","stack","trace","pretty print","prettify","format","human","callsites","callsite","show error","handling exceptions","pretty log","pretty json","pretty-error","sourcemap"],"gitHead":"95f72db974fd8eeaef685dcb3256185567afc069","_id":"@alexandru_david/tslog@3.2.3","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-cv4O04+iUSBWlPUtWnEmu9Z/L4cGYlMvBAXnUHql4O09aL0d5cP62F0XsAKcBlvjwJcxnQk+NNlAhkhZzo2UIA==","shasum":"a3fc350ca2996aeed28e57dbcf041bab46517d57","tarball":"https://registry.npmjs.org/@alexandru_david/tslog/-/tslog-3.2.3.tgz","fileCount":46,"unpackedSize":268141,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICs5mgNGim2TXd+P+woX46FMoR20+W+mT0ZGKhmWBJbAAiEAmkpt8SaqbGbS213CK662fcxKo1OHkkcniIgWlpgx52Y="}]},"_npmUser":{"name":"alexandru_david","email":"alexandru.david@hotmail.com"},"directories":{},"maintainers":[{"name":"alexandru_david","email":"alexandru.david@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tslog_3.2.3_1636636446603_0.886736757097107"},"_hasShrinkwrap":false},"3.2.4":{"name":"@alexandru_david/tslog","version":"3.2.4","description":"📝 Expressive TypeScript Logger for Node.js: Pretty errors, stack traces, code frames, and JSON output to attachable transports.","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/types/index.d.ts","engines":{"node":">=10"},"scripts":{"ts-node":"ts-node example/index.ts","ts-node-onchange":"onchange -i \"**/*.ts\" -- npm run ts-node","start-ts":"npm run ts-node","start":"node dist/example/index.js","build":"tsc -b tsconfig.json tsconfig.esm.json tsconfig.types.json","prepublishOnly":"npm run build && npm run test","eslint":"eslint . --ext .ts","eslint-fix":"eslint . --ext .ts --fix","test":"jest","coveralls":"jest --coverage && coveralls < coverage/lcov.info","docsify-init":"docsify init ./docs","docsify-serve":"cd docs && docsify serve","api-extractor":"tsc && mkdir -p ./docs/api_extractor && api-extractor run --local --verbose","typedoc":"typedoc","generate-all-docs":"npm run api-extractor && typedoc","release":"np"},"jest":{"verbose":true,"preset":"ts-jest","testEnvironment":"node","collectCoverage":true,"testMatch":["/**/*.test.ts","/**/node_modules_test/*.test.ts"]},"np":{"yarn":false,"contents":"."},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/fullstack-build/tslog.git"},"authors":["Eugene Terehov <eugene@fullstack.build>"],"license":"MIT","bugs":{"url":"https://github.com/fullstack-build/tslog/issues"},"homepage":"https://tslog.js.org","devDependencies":{"@microsoft/api-extractor":"^7.18.5","@rushstack/eslint-config":"^2.4.0","@types/jest":"^27.0.1","@types/node":"^14.17.9","@types/source-map-support":"^0.5.4","@typescript-eslint/types":"^4.29.1","coveralls":"^3.1.1","docsify":"^4.12.1","eslint":"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","git-hooks":"^1.1.10","jest":"^27.0.6","np":"^7.5.0","onchange":"^7.1.0","prettier":"^2.3.2","ts-jest":"^27.0.4","ts-node":"^10.2.0","typedoc":"^0.21.5","typescript":"^4.3.5"},"dependencies":{"source-map-support":"^0.5.19"},"sideEffects":false,"keywords":["logger","typescript","log level","json","stacktrace","Error.stack","call location","debug","pretty","log","log4j","log4js","log4ts","print","logging","bunyan","winston","stack","trace","pretty print","prettify","format","human","callsites","callsite","show error","handling exceptions","pretty log","pretty json","pretty-error","sourcemap"],"gitHead":"2d93caf5431714c5bd09c538638f89db8d2dec4a","_id":"@alexandru_david/tslog@3.2.4","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-fBGz2rhhr1rI0rcvk2JQRHkycAJRxlWbIzPNHYGX4yVNa0b63T/Zrvagb5f5IgJEPyGy5g7mUo1BwiKmOIHrwA==","shasum":"f099668e12f078aaae8a512074b76c50d0e4ffe7","tarball":"https://registry.npmjs.org/@alexandru_david/tslog/-/tslog-3.2.4.tgz","fileCount":46,"unpackedSize":267487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxI6BCRA9TVsSAnZWagAAO7AQAJce4KEDtGYNlcutVFSn\ndbhRNqgkDPcNp1Ujy+NG3Ne3vaiaP4PO7b9aOSiIWN8euA9GTNrptYxJ9Cua\nODN4HUWVmeN2RpqUw7c6kSVKwb6xBYeTsT9BOeYLejXP1OF8LCASIJHdCf+x\n0/t17nW6sxY8kvFchOicXCTk98omNMLiMmgX7ISmkJOZeUnX/SDmd0uFQpvW\ngWyeYz6zqtReMoGeMOL60CG3MbUe+3xsuiYJCVmWAVMYqqTvl+yhtRIt0MvJ\nLID0DPtfwQgg79dT/RTtqBDJk9jjETEIW0Pv/E5/9BoRPw+UBnhXomA/WzRq\neCJeLK2JXacKIhVW+gduMmlzmLcNJ0zIz8PG0wFMpGs0f16k8Ik8LrfJGpF7\nIaGz0p0ho8JSMIAlieZU4GX3Rqz8LRO+dFyli5Nzg3jMMjzhLzze4UW04Qd5\ni+EKpMO8IJRx+ucU/NlOsWbeZZZyrApzw1LR4KLzgHrBZoCgD1dAgsNY6zr4\n0DHAb9SueDLXzgMUEF5tuAqtyk7fMO0g6JmqP7txiLg/gvJHL3UCjkfG3ZJp\neQsJwdcgE2izT6zAV4HROzUb0JeP0rUhUv9P3CcgsxjpUpypuJMZjZ+/cU7i\nKnxBvkl6TVBHx8VFKq4ATP56PrqNXizjDr6CHSO+06/A6tdJ0Cw/XBFokRXq\nmoTT\r\n=e+hw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwQMPqw6m+jnGI7bWrxy5zuilZqWfcLM+hJbcPahq3IgIgayZWZAvYI54Jbzhfu7wG895zE1qLVGZaKLylzOlpPb4="}]},"_npmUser":{"name":"alexandru_david","email":"alexandru.david@hotmail.com"},"directories":{},"maintainers":[{"name":"alexandru_david","email":"alexandru.david@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tslog_3.2.4_1636638388959_0.9627788923419653"},"_hasShrinkwrap":false}},"time":{"created":"2021-11-11T12:56:08.648Z","3.2.2":"2021-11-11T12:56:08.884Z","modified":"2022-04-04T12:39:17.449Z","3.2.3":"2021-11-11T13:14:06.791Z","3.2.4":"2021-11-11T13:46:29.418Z"},"maintainers":[{"name":"alexandru_david","email":"alexandru.david@hotmail.com"}],"description":"📝 Expressive TypeScript Logger for Node.js: Pretty errors, stack traces, code frames, and JSON output to attachable transports.","homepage":"https://tslog.js.org","keywords":["logger","typescript","log level","json","stacktrace","Error.stack","call location","debug","pretty","log","log4j","log4js","log4ts","print","logging","bunyan","winston","stack","trace","pretty print","prettify","format","human","callsites","callsite","show error","handling exceptions","pretty log","pretty json","pretty-error","sourcemap"],"repository":{"type":"git","url":"git+https://github.com/fullstack-build/tslog.git"},"bugs":{"url":"https://github.com/fullstack-build/tslog/issues"},"license":"MIT","readme":"## 📝 tslog: Beautiful logging experience for Node.js with TypeScript support\n\n[![lang: Typescript](https://img.shields.io/badge/Language-Typescript-Blue.svg?style=flat-square)](https://www.typescriptlang.org)\n![License: MIT](https://img.shields.io/npm/l/tslog?logo=tslog&style=flat-square)\n[![npm version](https://img.shields.io/npm/v/tslog?color=76c800&logoColor=76c800&style=flat-square)](https://www.npmjs.com/package/tslog)\n![Dependency status](https://img.shields.io/david/fullstack-build/tslog?style=flat-square)\n[![CI: Travis](https://img.shields.io/travis/fullstack-build/tslog?style=flat-square)](https://travis-ci.com/github/fullstack-build/tslog)\n[![Coverage Status](https://img.shields.io/coveralls/github/fullstack-build/tslog?style=flat-square)](https://coveralls.io/github/fullstack-build/tslog)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n[![GitHub stars](https://img.shields.io/github/stars/fullstack-build/tslog.svg?style=social&label=Star)](https://github.com/fullstack-build/tslog)\n\n> Powerful, fast and expressive logging for Node.js\n\n![tslog pretty output](https://raw.githubusercontent.com/fullstack-build/tslog/master/docs/assets/tslog_pretty_output.png \"tslog pretty output\")\n\n### Highlights\n\n⚡ **Batteries included, native V8 integration**<br>\n👮‍️ **Fully typed with TypeScript support (exact code position)**<br>\n🗃 **_Pretty_ or `JSON` output**<br>\n⭕️ **Supports _circular_ structures**<br>\n🦸 **Custom pluggable loggers**<br>\n💅 **Object and error interpolation**<br>\n🕵️‍ **Code surrounding error position (_code frame_)**<br>\n🤓 **Stack trace through native V8 API**<br>\n🏗 **Works for TypeScript and JavaScript**<br>\n👨‍👧‍👦 **Child logger with inheritance**<br>\n🙊 **Mask/hide secrets and keys**<br>\n🔍 **Native support for request IDs (<a href=\"https://nodejs.org/api/async_hooks.html#async_hooks_async_hooks\" target=\"_blank\">`async_hooks`</a>, <a href=\"https://nodejs.org/api/async_hooks.html#async_hooks_class_asynclocalstorage\" target=\"_blank\">`AsyncLocalStorage`</a>)**<br>\n📦 **CommonJS and ES Modules with tree shaking support**<br>\n🧲 **Optionally catch all `console` logs**<br>\n✍️ **well documented**<br>\n\n### Example\n\n```typescript\nimport { Logger } from \"tslog\";\n\nconst log: Logger = new Logger();\nlog.silly(\"I am a silly log.\");\n```\n\n### Install\n\n```bash\nnpm install tslog\n```\n\n**Enable TypeScript source map support:**\n\nThis feature enables `tslog` to reference a correct line number in your TypeScript source code.\n\n```json5\n// tsconfig.json\n{\n  // ...\n  compilerOptions: {\n    // ...\n    sourceMap: true,\n    // we recommend using a current ES version\n    target: \"es2019\",\n  },\n}\n```\n\n### Simple example\n\n```typescript\nimport { Logger } from \"tslog\";\n\nconst log: Logger = new Logger({ name: \"myLogger\" });\nlog.silly(\"I am a silly log.\");\nlog.trace(\"I am a trace log with a stack trace.\");\nlog.debug(\"I am a debug log.\");\nlog.info(\"I am an info log.\");\nlog.warn(\"I am a warn log with a json object:\", { foo: \"bar\" });\nlog.error(\"I am an error log.\");\nlog.fatal(new Error(\"I am a pretty Error with a stacktrace.\"));\n```\n\n### All Features\n\n- **Log level:** `silly`, `trace`, `debug`, `info`, `warn`, `error`, `fatal` (different colors)\n- **Output to std:** Structured/_pretty_ output (easy parsable `tab` delimiters), `JSON` or suppressed\n- **Attachable transports:** Send logs to an external log aggregation services, file system, database, or email/slack/sms/you name it...\n- **StdOut or StdErr depends on log level:** **_stdout_** for `silly`, `trace`, `debug`, `info` and **_stderr_** for `warn`, `error`, `fatal`\n- **Minimum log level per output:** `minLevel` level can be set individually per transport\n- **Fully typed:** Written in TypeScript, fully typed, API checked with <a href=\"https://api-extractor.com\" target=\"_blank\">_api-extractor_</a>, <a href=\"https://github.com/microsoft/tsdoc\" target=\"_blank\">_TSDoc_</a> documented\n- **Source maps lookup:** Shows exact position also in TypeScript code (compile-to-JS), one click to IDE position\n- **Stack trace:** Callsites through native <a href=\"https://v8.dev/docs/stack-trace-api\" target=\"_blank\">_V8 stack trace API_</a>, excludes internal entries\n- **CommonJS and ES Modules**<br>\n- **Tree shake support** via ESM import syntax ([tree-shaking](https://webpack.js.org/guides/tree-shaking/))\n- **Pretty Error:** Errors and stack traces printed in a structured way and fully accessible through _JSON_ (e.g. external Log services)\n- **Code frame:** `tslog` captures and displays the source code that lead to an error, making it easier to debug\n- **Object/JSON highlighting:** Nicely prints out an object using native Node.js `utils.inspect` method\n- **Instance Name:** Logs capture instance name (default host name) making it easy to distinguish logs coming from different instances (e.g. serverless)\n- **Named Logger:** Logger can be named (e.g. useful for packages/modules and monorepos)\n- **Highly configurable:** All settings can be changed through a typed object, also during run time (e.g. log level)\n- **Adjust settings at runtime** Change settings at runtime with immediate impact (e.g. log level)\n- **Child Logger with inheritance** Powerful child loggers with settings inheritance, also at runtime\n- **RequestId:** Group logs originated from a request and follow them all the way down the promise chain\n- **Secrets masking:** Prevent passwords and secrets from sneaking into log files by masking them\n- **Short paths:** Paths are relative to the root of the application folder\n- **Prefixes:** Prefix log messages and bequeath prefixes to child loggers\n- **Types:** Display type information\n- **Runtime-agnostic:** Works with `ts-node`, `ts-node-dev`, as well as compiled down to JavaScript\n- **Optionally overwrite `console`:** Catch `console.log` etc. that would otherwise be hard to find\n- **Tested:** 100% code coverage, CI\n\n### API documentation\n\n#### [📘 TSDoc](https://fullstack-build.github.io/tslog/tsdoc/)\n\n#### <a name=\"logObject\"></a>Log object\n\n<a href=\"https://tslog.js.org/tsdoc/interfaces/ilogobject.html\" target=\"_blank\">TSDoc: `interface: ILogObject`</a>\n\nInternally `tslog` creates an object representing every available information around a particular log message, including errors, stack trace etc.\nThis information can become quite handy in case you want to work with this data or forward it to an external log service.\n\n```typescript\ninterface ILogObject {\n  /**  Optional name of the instance this application is running on. */\n  instanceName?: string;\n  /**  Optional name of the logger or empty string. */\n  loggerName?: string;\n  /* Name of the host */\n  hostname: string;\n  /** Optional unique request ID */\n  requestId?: string;\n  /**  Timestamp */\n  date: Date;\n  /**  Log level name (e.g. debug) */\n  logLevel: silly | trace | debug | info | warn | error | fatal;\n  /**  Log level ID (e.g. 3) */\n  logLevelId: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n  /**  Log arguments */\n  argumentsArray: (\n    | unknown\n    | {\n        /** Is this object an error? */\n        isError: true;\n        /** Name of the error*/\n        name: string;\n        /** Error message */\n        message: string;\n        /** additional Error details */\n        details: object;\n        /** native Error object */\n        nativeError: Error;\n        /** Stack trace of the error */\n        stack: IStackFrame[];\n        /** Code frame of the error */\n        codeFrame?: {\n          firstLineNumber: number;\n          lineNumber: number;\n          columnNumber: number | null;\n          linesBefore: string[];\n          relevantLine: string;\n          linesAfter: string[];\n        };\n      }\n  )[];\n  /**  Optional Log stack trace */\n  stack?: {\n    /** Relative path based on the main folder */\n    filePath: string;\n    /** Full path */\n    fullFilePath: string;\n    /** Name of the file */\n    fileName: string;\n    /** Line number */\n    lineNumber: number | null;\n    /** Column Name */\n    columnNumber: number | null;\n    /** Called from constructor */\n    isConstructor: boolean | null;\n    /** Name of the function */\n    functionName: string | null;\n    /** Name of the class */\n    typeName: string | null;\n    /** Name of the Method */\n    methodName: string | null;\n  }[];\n}\n```\n\nThere are three ways to access this object:\n\n##### Returned by each log method\n\n```typescript\nimport { Logger, ILogObject } from \"tslog\";\n\nconst log: Logger = new Logger();\n\nconst logWithTrace: ILogObject = log.trace(\n  \"I am a trace log with a stack trace.\"\n);\n\nconsole.log(JSON.stringify(logWithTrace, null, 2));\n```\n\n##### Printed out in _JSON_ mode\n\n```typescript\nnew Logger({ type: \"json\" });\n```\n\nResulting in the following output:\n![tslog log level json](https://raw.githubusercontent.com/fullstack-build/tslog/master/docs/assets/tslog_log_level_json.png)\n\n##### Forwarded to an attached transport\n\n<a href=\"#/?id=transports\">More details below</a>\n\n#### Log level\n\n`tslog` is highly customizable, however, it follows _convention over configuration_ when it comes to **log levels**.\nInternally a log level is represented by a numeric ID.\n\nAvailable log levels are:<br>\n`0: silly`, `1: trace`, `2: debug`, `3: info`, `4: warn`, `5: error`, `6: fatal`\n\nPer default log level 0 - 3 are written to `stdout` and 4 - 6 are written to `stderr`.\nEach log level is printed in a different color, that is customizable through the settings object.\n\n> **Hint:** Log level `trace` behaves a bit differently compared to all the other log levels.\n> While it is possible to activate a stack trace for every log level, it is already activated for `trace` by default.\n> That means every `trace` log will also automatically capture and print its entire stack trace.\n\n```typescript\nimport { Logger } from \"tslog\";\n\nconst log: Logger = new Logger();\nlog.silly(\"I am a silly log.\");\nlog.trace(\"I am a trace log with a stack trace.\");\nlog.debug(\"I am a debug log.\");\nlog.info(\"I am an info log.\");\nlog.warn(\"I am a warn log with a json object:\", { foo: \"bar\" });\nlog.error(\"I am an error log.\");\nlog.fatal(new Error(\"I am a pretty Error with a stacktrace.\"));\n```\n\nStructured (aka. _pretty_) log level output would look like this:\n![tslog log level structured](https://raw.githubusercontent.com/fullstack-build/tslog/master/docs/assets/tslog_log_level_pretty.png \"tslog log level structured\")\n\n> **Hint:** Each logging method has a return type, which is a _JSON_ representation of the log message (`ILogObject`).\n> You can use this object to access its stack trace etc.\n> <a href=\"#logObject\">More details</a>\n\n#### Child Logger\n\nEach `tslog` Logger instance can create child loggers and bequeath its settings to a child.\nIt is also possible to overwrite every setting when creating a child.<br>\nChild loggers are a powerful feature when building a modular application and due to its inheritance make it easy to configure the entire application.\n\nUse `getChildLogger()` to create a child logger based on the current instance.\n\n**Example:**\n\n```typescript\nconst logger: Logger = new Logger({ name: \"MainLogger\" });\n\nconst childLogger: Logger = logger.getChildLogger({ name: \"FirstChild\" });\n\nconst grandchildLogger: Logger = childLogger.getChildLogger({\n  name: \"GrandChild\",\n});\n```\n\n#### Creating logger without source map support\n\nBy default, `Logger` creates instance with stack trace's source mapping support. For some cases, it may not be needed. `LoggerWithoutCallSite` returns same interface as `Logger` does and only disabling call site wrapping for source map.\n\n```typescript\nimport { Logger, LoggerWithoutCallSite } from 'tslog';\n\nconst logger = new Logger(...);\nconst loggerWithoutCallSite = new LoggerWithoutCallSite(...);\n\n```\n\nSince `tslog` supports [tree-shaking](https://webpack.js.org/guides/tree-shaking/) via esm import syntax, importing `LoggerWithoutCallSite` without `Logger` will reduce overall bundle size.\n\n#### Settings\n\nAs `tslog` follows _convention over configuration_, it already comes with reasonable default settings.\nTherefor all settings are optional. Nevertheless, they can be flexibly adapted to your own needs.\n\nAll possible settings are defined in the `ISettingsParam` interface and modern IDEs will provide auto-completion accordingly.\n\n**You can use `setSettings()` to adjust settings at runtime.**\n\n> **Hint:** When changing settings at runtime this alternation would also propagate to every child loggers, as long as it has not been overwritten down the hierarchy.\n\n##### `type`\n\n`default: \"pretty\"`\n\nPossible values: `\"json\" | \"pretty\" | \"hidden\"`\n\nYou can either `pretty` print logs, print them as `json` or hide them all together with `hidden` (e.g. when using custom transports).<br>\nHaving `json` as an output format is particularly useful, if you want to forward your logs directly from your `std` to another log service.\nInstead of parsing a _pretty_ output, most log services prefer a _JSON_ representation.\n\n> **Hint:** Printing in `json` gives you direct access to all the available information, like _stack trace_ and _code frame_ and so on.\n\n```typescript\nnew Logger({ type: \"json\" });\n```\n\n_Output:_\n![tslog log level json](https://raw.githubusercontent.com/fullstack-build/tslog/master/docs/assets/tslog_log_level_json.png)\n\n> **Hint:** Each _JSON_ log is printed in one line, making it easily parsable by external services.\n\n##### `instanceName`\n\n`default: os.hostname` _(hidden by default)_\n\nYou can provide each logger with the name of the instance, making it easy to distinguish logs from different machines.\nThis approach works well in the serverless environment as well, allowing you to filter all logs coming from a certain instance.\n\nPer default `instanceName` is pre-filled with the `hostname` of your environment, which can be overwritten.\nHowever, this value is hidden by default in order to keep the log clean and tidy.\nYou can change this behavior by setting `displayInstanceName` to `true`.\n\n```typescript\nconst logger: Logger = new Logger({ displayInstanceName: true });\n// Would print out the host name of your machine\n\nconst logger: Logger = new Logger({\n  displayInstanceName: true,\n  instanceName: \"ABC\",\n});\n// Would print out ABC as the name of this instance\n```\n\n##### `name`\n\n`default: undefined`\n\nEach logger has an optional name, that is hidden by default. You can change this behavior by setting `displayLoggerName` to `true`.\nThis setting is particularly interesting when working in a `monorepo`,\ngiving you the possibility to provide each module/package with its own logger and being able to distinguish logs coming from different parts of your application.\n\n```typescript\nnew Logger({ name: \"myLogger\" });\n```\n\n_Additional Setting:_\n\n`setCallerAsLoggerName: false`\n\nWhen setting to `true` `tslog` will use caller name as the default name of the logger.\n\n```typescript\nnew Logger({ setCallerAsLoggerName: true });\n```\n\n##### `minLevel`\n\n`default: \"silly\"`\n\nMinimum log level to be captured by this logger.\nPossible values are: `silly`, `trace`, `debug`, `info`, `warn`, `error`, `fatal`\n\n##### `requestId`\n\n`default: undefined`\n\n**❗ Keep track of all subsequent calls and promises originated from a single request (e.g. HTTP).**\n\nIn a real world application a call to an API would lead to many logs produced across the entire application.\nWhen debugging it can get quite handy to be able to group all logs based by a unique identifier `requestId`.\n\nA `requestId` can either be a `string` or a function.<br>\nA string is suitable when you create a child logger for each request, while a function is helpful, when you need to reuse the same logger and need to obtain a `requistId` dynamically.\n\n**With Node.js 13.10, we got a new feature called <a href=\"https://nodejs.org/api/async_hooks.html#async_hooks_class_asynclocalstorage\" target=\"_blank\">AsyncLocalStorage.</a>**<br>\nIt has also been backported to Node.js v12.17.0 and of course it works with Node.js >= 14.<br>\nHowever it is still marked as _experimental_. <br>\nHere is <a href=\"https://itnext.io/one-node-js-cls-api-to-rule-them-all-1670ac66a9e8\" target=\"_blank\">a blog post by Andrey Pechkurov</a> describing `AsyncLocalStorage` and performing a small performance comparison.\n\n> **Hint**: If you prefer to use a more proven (yet slower) approach, you may want to check out <a href=\"https://www.npmjs.com/package/cls-hooked\" target=\"_blank\">`cls-hooked`</a>.\n\nEven though `tslog` is generic enough and works with any of these solutions our example is based on `AsyncLocalStorage`.<br>\n`tslog` also works with any API framework (like `Express`, `Koa`, `Hapi` and so on), but we are going to use `Koa` in this example.<br>\nBased on this example it should be rather easy to create an `Express` or another middleware.\n\nSome provides (e.g. `Heroku`) already set a `X-Request-ID` header, which we are going to use or fallback to a short ID generated by <a href=\"https://www.npmjs.com/package/nanoid\" target=\"_blank\">`nanoid`</a>.\n\n**In this example every subsequent logger is a child logger of the main logger and thus inherits all of its settings making `requestId` available throughout the entire application without any further ado.**\n\n_index.ts:_\n\n```typescript\nimport * as Koa from \"koa\";\nimport { AsyncLocalStorage } from \"async_hooks\";\nimport { customAlphabet } from \"nanoid\";\n\nconst asyncLocalStorage: AsyncLocalStorage<{ requestId: string }> =\n  new AsyncLocalStorage();\n\nconst logger: Logger = new Logger({\n  name: \"Server\",\n  requestId: (): string => {\n    return asyncLocalStorage.getStore()?.requestId as string;\n  },\n});\nexport { logger };\n\nconst app: Koa = new Koa();\n\n/** START AsyncLocalStorage requestId middleware **/\nkoaApp.use(async (ctx: Koa.Context, next: Koa.Next) => {\n  // use x-request-id or fallback to a nanoid\n  const requestId: string =\n    ctx.request.headers[\"x-request-id\"] ||\n    customAlphabet(\"1234567890abcdefghijklmnopqrstuvwxyz\", 6)();\n  // every other Koa middleware will run within the AsyncLocalStorage context\n  await asyncLocalStorage.run({ requestId }, async () => {\n    return next();\n  });\n});\n/** END AsyncLocalStorage requestId middleware **/\n```\n\n_other_file.ts:_\n\n```typescript\nimport { logger } from \"./index\";\n\nconst childLogger = logger.getChildLogger({ name: \"ChildLogger\" });\n\nchildLogger.info(\"Log containing requestId\"); // <-- will contain a requestId\n```\n\n##### `exposeStack`\n\n`default: false`\n\nUsually, only _Errors_ and log level `trace` logs would capture the entire stack trace.\nBy enabling this option **every** stack trace of every log message is going to be captured.\n\n```typescript\nnew Logger({ exposeStack: true });\n```\n\n![tslog with a stack trace](https://raw.githubusercontent.com/fullstack-build/tslog/master/docs/assets/tslog_stacktrace.png)\n\n> **Hint:** When working in an IDE like _WebStorm_ or an editor like _VSCode_ you can click on the path leading you directly to the position in your source code.\n\n##### `exposeErrorCodeFrame`\n\n`default: true`\n\nA nice feature of `tslog` is to capture the _code frame_ around the error caught, showing the _exact_ location of the error.\nWhile it comes quite handy during development, it also means that the source file (_.js or _.ts) needs to be loaded.\nWhen running in production, you probably want as much performance as possible and since errors are analyzed at a later point in time,\nyou may want to disable this feature.\nIn order to keep the output clean and tidy, code frame does not follow into `node_modules`.\n\n```typescript\nnew Logger({ exposeErrorCodeFrame: false });\n```\n\n> **Hint:** By default 5 lines before and after the line with the error will be displayed.\n> You can adjust this setting with `exposeErrorCodeFrameLinesBeforeAndAfter`.\n\n![tslog with a code frame](https://raw.githubusercontent.com/fullstack-build/tslog/master/docs/assets/tslog_code_frame.png)\n\n##### `ignoreStackLevels`\n\n`default: 3`\n\nDefines how many stack levels should be ignored.\n`tslog` adds additional 3 layers to the stack and that the reason why the default is set to `3`.\nYou can increase this number, if you want to add additional layers (e.g. a factory class or a facade).\n\n##### `suppressStdOutput`\n\n`default: false`\n\nIt is possible to connect multiple _transports_ (external loggers) to `tslog` (see below).\nIn this case it might be useful to suppress all output.\n\n```typescript\nnew Logger({ suppressStdOutput: true });\n```\n\n##### `overwriteConsole`\n\n`default: false`\n\n`tslog` is designed to be used directly through its API.\nHowever, there might be use cases, where you want to make sure to capture all logs,\neven though they might occur in a library or somebody else's code.\nOr maybe you prefer or used to work with `console`, like `console.log`, `console.warn` and so on.\n\nIn this case, you can advise `tslog` to overwrite the default behavior of `console`.\n\n> **Hint:** It is only possible to overwrite `console` once, so the last attempt wins.\n> If you wish to do so, I would recommend to have a designated logger for this purpose.\n\n```typescript\nnew Logger({ name: \"console\", overwriteConsole: true });\n```\n\n`tslog` applies the following mapping:\n\n- `console.log`: `silly`\n- `console.trace`: `trace`\n- `console.info`: `info`\n- `console.warn`: `warn`\n- `console.error`: `error`\n\n_There is no `console.fatal`._\n\n##### `colorizePrettyLogs`\n\n`default: true`\n\nBy default `pretty` output is colorized with ANSI escape codes. If you prefer a plain output, you can disable the colorization with this setting.\n\n##### `logLevelsColors`\n\nThis setting allows you to overwrite the default log level colors of `tslog`.\n\nPossible styles are:\n\n- <a href=\"https://nodejs.org/api/util.html#util_foreground_colors\" target=\"_blank\">Foreground colors</a>\n- <a href=\"https://nodejs.org/api/util.html#util_background_colors\" target=\"_blank\">Background colors</a>\n- <a href=\"https://nodejs.org/api/util.html#util_modifiers\" target=\"_blank\">Modifiers</a>\n\n##### `prettyInspectHighlightStyles`\n\nThis setting allows you to overwrite the default colors of `tslog` used for the native Node.js `utils.inspect` interpolation.\n\nMore Details: <a href=\"https://nodejs.org/api/util.html#util_customizing_util_inspect_colors\" target=\"_blank\">Customizing util.inspect colors</a>\n\n##### `delimiter`\n\n`default: [ ] (space)`\nSet a custom pretty log delimiter.\n\n##### `dateTimePattern`\n\n`default: \"year-month-day hour:minute:second.millisecond\"`\n\n> **Caution!** Changing this pattern will affect performance (invocation of Intl.DateTimeFormat)\n\nChange the way `tslog` prints out the date.\nBased on Intl.DateTimeFormat formatToParts with additional milliseconds, you can use type as a placeholder.\nAvailable placeholders are: `day`, `dayPeriod`, `era`, `hour`, `literal`, `minute`, `month`, `second`, `millisecond`, `timeZoneName`, `weekday` and `year`.\n\n##### `dateTimeTimezone`\n\n`default: \"utc\" `\n\nDefine in which timezone the date should be printed in.\nPossible values are `utc` and <a href=\"https://www.iana.org/time-zones\" target=\"_blank\">IANA (Internet Assigned Numbers Authority)</a> based timezones, e.g. `Europe/Berlin`, `Europe/Moscow` and so on.\n\n> **Hint:** If you want to use your local time zone, you can set:\n> `dateTimeTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone`\n\n> **Caution!** Changing this pattern will affect performance (invocation of Intl.DateTimeFormat)\n\n##### `prefix`\n\n`default: [] `\n\nPrefix every log message with an array of additional attributes.<br>\nPrefixes propagate to child loggers and can help to follow a chain of promises.<br>\nIn addition to `requestId`, prefixes can help further distinguish different parts of a request.\n\n> **Hint:** A good example could be a GraphQL request, that by design could consist of multiple queries and/or mutations.<br>\n> A `requestId` would mark all the operations and prefixes can help to distinguish separate queries/mutations inside of this request.\n\n**Example:**\n\n```typescript\nconst logger: Logger = new Logger({\n  name: \"MainLogger\",\n  prefix: [\"main\", \"parent\"],\n});\nlogger.info(\"MainLogger message\");\n// Output:\n// INFO   [MainLogger]   main  parent  MainLogger message\n\nconst childLogger: Logger = logger.getChildLogger({\n  name: \"FirstChild\",\n  prefix: [\"child1\"],\n});\nchildLogger.info(\"child1 message\");\n// Output:\n// INFO   [FirstChild]   main  parent  child1  child1 message\n\nconst grandchildLogger: Logger = childLogger.getChildLogger({\n  name: \"GrandChild\",\n  prefix: [\"grandchild1\"],\n});\ngrandchildLogger.silly(\"grandchild1 message\");\n// Output:\n// INFO   [GrandChild]   main  parent  child1  grandchild1 grandchild1 message\n\n// change settings during runtime\nchildLogger.setSettings({ prefix: [\"renamedChild1\"] });\ngrandchildLogger.silly(\"grandchild1 second message\");\n// Output:\n// INFO   [GrandChild]   main  parent  renamedChild1     grandchild1 second message\n```\n\n##### `maskValuesOfKeys`\n\n`default: [\"password\"] `\n\nOne of the most common ways of a password/secrets breach is through log files.\nGiven the central position of `tslog` as the collecting hub of all application logs, it's only natural to use it as a filter.\n`maskValuesOfKeys` makes it possible to hide/mask all values of fields from objects passed into `tslog`.\n\n**`maskValuesOfKeys` is case insensitive!**\n\n```typescript\nconst secretiveLogger = new Logger({\n  name: \"SecretiveLogger\",\n  maskValuesOfKeys: [\"test\", \"authorization\", \"password\"],\n});\n\nlet secretiveObject = {\n  Authorization: 1234567,\n  regularString: \"I am just a regular string.\",\n  user: {\n    name: \"Test\",\n    otherString: \"Test123.567\",\n    password: \"swordfish\",\n  },\n};\n\nsecretiveLogger.info(secretiveObject);\n\n// Output:\n// INFO   [SecretiveLogger]\n// {\n//   Authorization: '[***]',\n//   regularString: 'I am just a regular string.',\n//   user: {\n//     name: \"Test\",\n//     otherString: \"Test123.567\",\n//     password: '[***]',\n//   }\n// }\n```\n\n##### `maskAnyRegEx`\n\n`default: [] `\n\nWhen `maskValuesOfKeys` is just not enough, and you really want to make sure no secrets get populated, you can also use `maskAnyRegEx` to mask every occurrence of a string matching a particular RegEx.\n\n> **Hint:** It will also mask keys if it encounters a matching pattern.\n\n**`maskValuesOfKeys` is case sensitive!**\n\n```typescript\nconst verySecretiveLogger = new Logger({\n  name: \"SecretiveLogger\",\n  maskValuesOfKeys: [\"test\", \"authorization\", \"password\"],\n  maskAnyRegEx: [\"pass.*\"], // mask every string that starts with \"pass\"\n});\n\nlet secretiveObject = {\n  Authorization: 1234567,\n  regularString: \"I am just a regular string.\",\n  user: {\n    name: \"Test\",\n    otherString: \"pass1234.567\",\n    password: \"swordfish\",\n  },\n};\n\nverySecretiveLogger.info(secretiveObject);\n\n// Output:\n// INFO   [SecretiveLogger]\n// {\n//   Authorization: '[***]',\n//   regularString: 'I am just a regular string.',\n//   user: {\n//     name: \"Test\",\n//     otherString: \"[***].567\",\n//     password: '[***]',\n//   }\n// }\n```\n\n> **Hint:** useful for API keys and other secrets (e.g. from ENVs).\n\n##### `maskPlaceholder`\n\n`default: \"[***]\" `\n\nString to use for masking of secrets (s. `maskAnyRegEx` & `maskValuesOfKeys`)\n\n##### `printLogMessageInNewLine`\n\n`default: false `\n\nBy default `tslog` uses `tab` delimiters for separation of the meta information (date, log level, etc.) and the log parameters.\nSince the meta information can become quite long, you may want to prefer to print the log attributes in a new line.\n\n##### `displayDateTime`\n\n`default: true `\n\nDefines whether the date time should be displayed.\n\n##### `displayLogLevel`\n\n`default: true `\n\nDefines whether the log level should be displayed.\n\n##### `displayInstanceName`\n\n`default: false `\n\nDefines whether the instance name (e.g. host name) should be displayed.\n\n##### `displayLoggerName`\n\n`default: true `\n\nDefines whether the optional logger name should be displayed.\n\n##### `displayRequestId`\n\n`default: true `\n\nDefines whether the `requestId` should be displayed, if set and available (s. `requestId`).\n\n##### `displayFunctionName`\n\n`default: true `\n\nDefines whether the class and method or function name should be displayed.\n\n##### `displayTypes`\n\n`default: false `\n\nDefines whether type information (`typeof`) of every attribute passed to `tslog` should be displayed.\n\n##### `displayFilePath`\n\n`default: hideNodeModulesOnly `\n\nDefines whether file path and line should be displayed or not.\nThere are 3 possible settgins:\n\n- `hidden`\n- `displayAll`\n- `hideNodeModulesOnly` (default): This setting will hide all file paths containing `node_modules`.\n\n##### `stdOut` and `stdErr`\n\nThis both settings allow you to replace the default `stdOut` and `stdErr` _WriteStreams_.\nHowever, this would lead to a colorized output. We use this setting mostly for testing purposes.\nIf you want to redirect the output or directly access any logged object, we advise you to **attach a transport** (see below).\n\n#### <a name=\"transport\"></a>Transports\n\n`tslog` focuses on the one thing it does well: capturing logs.\nTherefore, there is no build-in _file system_ logging, _log rotation_, or similar.\nPer default all logs go to `stdOut` and `stdErr` respectively.\n\nHowever, you can easily attach as many _transports_ as you wish, enabling you to do fancy stuff\nlike sending a message to _Slack_ or _Telegram_ in case of an urgent error.\n\nWhen attaching a transport, you _must_ implement every log level.\nAll of them could be potentially handled by the same function, though.\n\nEach _transport_ can have its own `minLevel`.\n\n**Attached transports are also inherited to child loggers.**\n\n##### Simple transport example\n\nHere is a very simple implementation used in our _jest_ tests:\n\n```typescript\nimport { ILogObject, Logger } from \"tslog\";\n\nconst transportLogs: ILogObject[] = [];\n\nfunction logToTransport(logObject: ILogObject) {\n  transportLogs.push(logObject);\n}\n\nconst logger: Logger = new Logger();\n\nlogger.attachTransport(\n  {\n    silly: logToTransport,\n    debug: logToTransport,\n    trace: logToTransport,\n    info: logToTransport,\n    warn: logToTransport,\n    error: logToTransport,\n    fatal: logToTransport,\n  },\n  \"debug\"\n);\n```\n\n##### Storing logs in a file\n\nHere is an example how to store all logs in a file.\n\n```typescript\nimport { ILogObject, Logger } from \"tslog\";\nimport { appendFileSync } from \"fs\";\n\nfunction logToTransport(logObject: ILogObject) {\n  appendFileSync(\"logs.txt\", JSON.stringify(logObject) + \"\\n\");\n}\n\nconst logger: Logger = new Logger();\nlogger.attachTransport(\n  {\n    silly: logToTransport,\n    debug: logToTransport,\n    trace: logToTransport,\n    info: logToTransport,\n    warn: logToTransport,\n    error: logToTransport,\n    fatal: logToTransport,\n  },\n  \"debug\"\n);\n\nlogger.debug(\"I am a debug log.\");\nlogger.info(\"I am an info log.\");\nlogger.warn(\"I am a warn log with a json object:\", { foo: \"bar\" });\n```\n\n**Result:** `logs.txt`\n\n```json\n{\"loggerName\":\"\",\"date\":\"2020-04-27T15:24:04.334Z\",\"logLevel\":\"debug\",\"logLevelId\":2,\"filePath\":\"example/index.ts\",\"fullFilePath\":\"/Users/eugene/Development/workspace/tslog/example/index.ts\",\"fileName\":\"index.ts\",\"lineNumber\":56,\"columnNumber\":5,\"isConstructor\":false,\"functionName\":null,\"typeName\":\"Object\",\"methodName\":null,\"argumentsArray\":[\"I am a debug log.\"]}\n{\"loggerName\":\"\",\"date\":\"2020-04-27T15:24:04.334Z\",\"logLevel\":\"info\",\"logLevelId\":3,\"filePath\":\"example/index.ts\",\"fullFilePath\":\"/Users/eugene/Development/workspace/tslog/example/index.ts\",\"fileName\":\"index.ts\",\"lineNumber\":57,\"columnNumber\":5,\"isConstructor\":false,\"functionName\":null,\"typeName\":\"Object\",\"methodName\":null,\"argumentsArray\":[\"I am an info log.\"]}\n```\n\n#### Helper\n\n##### prettyError\n\nSometimes you just want to _pretty print_ an error without having to log it, or maybe just catch its call sites, or it's stack frame? If so, this helper is for you.\n`prettyError` exposes all the awesomeness of `tslog` without the actual logging. A possible use case could be in a CLI, or other internal helper tools.\n\nExample:\n\n```typescript\nconst logger: Logger = new Logger();\nconst err: Error = new Error(\"Test Error\");\nlogger.prettyError(err);\n```\n\n_Additional Parameters:_\n\n- `error` - Error object\n- `print` - Print the error or return only? _(default: true)_\n- `exposeErrorCodeFrame` - Should the code frame be exposed? _(default: true)_\n- `exposeStackTrace` - Should the stack trace be exposed? _(default: true)_\n- `stackOffset` - Offset lines of the stack trace _(default: 0)_\n- `stackLimit` - Limit number of lines of the stack trace _(default: Infinity)_\n- `std` - Which std should the output be printed to? _(default: stdErr)_\n\n##### printPrettyLog\n\nIf you just want to _pretty print_ an error on a custom output (for adding a new transport for example),\nyou can just call `logger.printPrettyLog(myStd, myLogObject)` where myStd is an instance of `IStd` (e.g. `process.stdout`, `process.stderr` or even a custom one, see example below):\n\n```typescript\nclass SimpleStd implements IStd {\n  constructor(private _buffer: string = \"\") {}\n  write(message: string) {\n    this._buffer += message;\n  }\n\n  get buffer(): string {\n    return this._buffer;\n  }\n}\n\nconst logger: Logger = new Logger();\n\nconst myStd = new SimpleStd();\nconst myLogObject = logger.info(\"Hello World\");\nlogger.printPrettyLog(myStd, myLogObject);\n```\n","readmeFilename":"README.md"}