Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
terehov committed Nov 24, 2020
2 parents 4b3810d + 8796b57 commit 38864a1
Show file tree
Hide file tree
Showing 10 changed files with 804 additions and 2,248 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12
14
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
👨‍👧‍👦 **Child logger with inheritance**<br>
🙊 **Mask/hide secrets and keys**<br>
🔍 **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>
🌳 **Tree shaking support**<br>
📦 **CommonJS and ES Modules support with tree shaking support**<br>
🧲 **Optionally catch all `console` logs**<br>
✍️ **well documented**<br>

Expand Down Expand Up @@ -55,11 +55,15 @@ This feature enables `tslog` to reference a correct line number in your TypeScri
// ...
"compilerOptions": {
// ...
"sourceMap": true
"sourceMap": true,
// we recommend using an current ES version
"target": "es2019",
}
}
```



### Simple example

```typescript
Expand All @@ -85,7 +89,8 @@ log.fatal(new Error("I am a pretty Error with a stacktrace."));
* **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
* **Source maps lookup:** Shows exact position also in TypeScript code (compile-to-JS), one click to IDE position
* **Stack trace:** Callsites through native <a href="https://v8.dev/docs/stack-trace-api" target="_blank">_V8 stack trace API_</a>, excludes internal entries
* **Tree shake suport** via esm import syntax ([tree-shaking](https://webpack.js.org/guides/tree-shaking/))
* **CommonJS and ES Modules**<br>
* **Tree shake support** via ESM import syntax ([tree-shaking](https://webpack.js.org/guides/tree-shaking/))
* **Pretty Error:** Errors and stack traces printed in a structured way and fully accessible through _JSON_ (e.g. external Log services)
* **Code frame:** `tslog` captures and displays the source code that lead to an error, making it easier to debug
* **Object/JSON highlighting:** Nicely prints out an object using native Node.js `utils.inspect` method
Expand Down Expand Up @@ -513,6 +518,10 @@ This setting allows you to overwrite the default colors of `tslog` used for the

More Details: <a href="https://nodejs.org/api/util.html#util_customizing_util_inspect_colors" target="_blank">Customizing util.inspect colors</a>

##### `delimiter`
```default: [ ] (space)```
Set a custom pretty log delimiter.

##### `dateTimePattern`
```default: "year-month-day hour:minute:second.millisecond"```

Expand Down
Loading

0 comments on commit 38864a1

Please sign in to comment.