|
27 | 27 | 🦸 **Custom pluggable loggers**<br> |
28 | 28 | 💅 **Object and error interpolation**<br> |
29 | 29 | 🤓 **Stack trace and pretty errors**<br> |
30 | | -👨👧👦 **Sub logger with inheritance**<br> |
| 30 | +👨👧👦 **Sub-logger with inheritance**<br> |
31 | 31 | 🙊 **Mask/hide secrets and keys**<br> |
32 | 32 | 📦 **CJS & ESM with tree shaking support**<br> |
33 | 33 | ✍️ **Well documented and tested**<br> |
@@ -181,7 +181,7 @@ logger.fatal(new Error("I am a pretty Error with a stacktrace.")); |
181 | 181 | - **Object/JSON highlighting:** Nicely prints out objects |
182 | 182 | - **Instance Name**: _(Server-side only)_ Logs capture instance name (default host name) making it easy to distinguish logs coming from different instances |
183 | 183 | - **Named Logger:** Logger can be named (e.g. useful for packages/modules and monorepos) |
184 | | -- **Sub Logger with inheritance:** Powerful sub-loggers with settings inheritance, also at runtime |
| 184 | +- **Sub-logger with inheritance:** Powerful sub-loggers with settings inheritance, also at runtime |
185 | 185 | - **Secrets masking:** Prevent passwords and secrets from sneaking into log files by masking them |
186 | 186 | - **Short paths:** Paths are relative to the root of the application folder |
187 | 187 | - **Prefixes:** Prefix log messages and bequeath prefixes to child loggers |
@@ -309,7 +309,7 @@ const hiddenLogger = new Logger({type: "hidden"}); |
309 | 309 |
|
310 | 310 | Each logger has an optional name. |
311 | 311 | You can find the name of the logger responsible for a log inside the `Meta`-object or printed in `pretty` mode. |
312 | | -Names get also inherited to sub loggers and can be found inside the `Meta`-object `parentNames` as well as printed out with a separator (e.g. `:`) in `pretty` mode. |
| 312 | +Names get also inherited to sub-loggers and can be found inside the `Meta`-object `parentNames` as well as printed out with a separator (e.g. `:`) in `pretty` mode. |
313 | 313 |
|
314 | 314 | Simple name example: |
315 | 315 | ```typescript |
@@ -462,7 +462,7 @@ There are multiple ways of masking secrets, before they get exposed: |
462 | 462 |
|
463 | 463 | #### Prefixing logs |
464 | 464 | Prefix every log message with an array of additional attributes.<br> |
465 | | -Prefixes propagate to sub loggers and can help to follow a chain of promises.<br> |
| 465 | +Prefixes propagate to sub-loggers and can help to follow a chain of promises.<br> |
466 | 466 | In addition to <a href="https://nodejs.org/api/async_hooks.html#async_hooks_class_asynclocalstorage" target="_blank">`AsyncLocalStorage`</a>, prefixes can help further distinguish different parts of a request. |
467 | 467 |
|
468 | 468 | > **Hint:** A good example could be a GraphQL request, that by design could consist of multiple queries and/or mutations. |
@@ -679,7 +679,7 @@ When debugging it can be quite handy to be able to group all logs based on a uni |
679 | 679 |
|
680 | 680 | Some providers (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>. |
681 | 681 |
|
682 | | -**In this example every subsequent logger is a sub logger of the main logger and thus inherits all of its settings making `requestId` available throughout the entire application without any further ado.** |
| 682 | +**In this example every subsequent logger is a sub-logger of the main logger and thus inherits all of its settings making `requestId` available throughout the entire application without any further ado.** |
683 | 683 |
|
684 | 684 | `tslog` works with any API framework (like `Express`, `Koa`, `Hapi` and so on), but in this example we are using `Koa`. |
685 | 685 | ```typescript |
@@ -722,7 +722,7 @@ Some providers (e.g. `Heroku`) already set a `X-Request-ID` header, which we are |
722 | 722 | // log request |
723 | 723 | logger.silly({ originalUrl: ctx.originalUrl, status: ctx.response.status, message: ctx.response.message }); |
724 | 724 |
|
725 | | - // also works with a sub logger |
| 725 | + // also works with a sub-logger |
726 | 726 | const subLogger = logger.getSubLogger(); |
727 | 727 | subLogger.info("Log containing requestId"); // <-- will contain a requestId |
728 | 728 |
|
|
0 commit comments