Skip to content

Commit

Permalink
Merge pull request #164 from fullstack-build/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
terehov authored Nov 17, 2022
2 parents 51070aa + 2792ae8 commit ee17c7f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 35 deletions.
17 changes: 1 addition & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ const hiddenLogger = new Logger({type: "hidden"});
```


#### Name
#### name

Each logger has an optional name.
You can find the name of the logger responsible for a log inside the `Meta`-object or printed in `pretty` mode.
Expand Down Expand Up @@ -630,21 +630,6 @@ const logMsg = logger.info("Test");
> **`tslog` follows a semantic release policy.** A major version change indicates breaking changes.<br><br>
> `tslog >=4` is less limiting when it comes to configuration. There are many use cases (especially when it comes to integration with 3rd party services) that now can be achieved elegantly and were not possible before.
### Name and other constructor parameters

`tslog` < 4 had a name parameter on the constructor. v4 removed all preconfigured parameters and allows you to create your own log object (s. "Defining and accessing `logObj`").

**OLD:** `tslog` < 4
```typescript
const log: Logger = new Logger({ type: "json", name: "myLogger" });
```

**NEW:** `tslog` >= 4
```typescript
const log = new Logger({ type: "json" }, { name: "DefaultLogger" });
```


### RequestID: Mark a request (e.g. HTTP) call with AsyncLocalStorage and `tslog`
>**Node.js 13.10 introduced a new feature called <a href="https://nodejs.org/api/async_hooks.html#async_hooks_class_asynclocalstorage" target="_blank">AsyncLocalStorage.</a>**<br>
Expand Down
17 changes: 1 addition & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ const hiddenLogger = new Logger({type: "hidden"});
```


#### Name
#### name

Each logger has an optional name.
You can find the name of the logger responsible for a log inside the `Meta`-object or printed in `pretty` mode.
Expand Down Expand Up @@ -630,21 +630,6 @@ const logMsg = logger.info("Test");
> **`tslog` follows a semantic release policy.** A major version change indicates breaking changes.<br><br>
> `tslog >=4` is less limiting when it comes to configuration. There are many use cases (especially when it comes to integration with 3rd party services) that now can be achieved elegantly and were not possible before.
### Name and other constructor parameters

`tslog` < 4 had a name parameter on the constructor. v4 removed all preconfigured parameters and allows you to create your own log object (s. "Defining and accessing `logObj`").

**OLD:** `tslog` < 4
```typescript
const log: Logger = new Logger({ type: "json", name: "myLogger" });
```

**NEW:** `tslog` >= 4
```typescript
const log = new Logger({ type: "json" }, { name: "DefaultLogger" });
```


### RequestID: Mark a request (e.g. HTTP) call with AsyncLocalStorage and `tslog`
>**Node.js 13.10 introduced a new feature called <a href="https://nodejs.org/api/async_hooks.html#async_hooks_class_asynclocalstorage" target="_blank">AsyncLocalStorage.</a>**<br>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tslog",
"version": "4.0.4",
"version": "4.1.0",
"description": "📝 Extensible TypeScript Logger for Node.js and Browser: Dependency free, Fully customizable, Pretty errors, stack traces, and JSON output to attachable transports.",
"author": "Eugene <[email protected]> (http://fullstack.build/)",
"license": "MIT",
Expand Down

0 comments on commit ee17c7f

Please sign in to comment.