You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ Browser:
108
108
```typescript
109
109
import { Logger } from"tslog";
110
110
111
-
const logger =newLogger({ name: "myLogger" });
111
+
const logger =newLogger();
112
112
logger.silly("I am a silly log.");
113
113
logger.trace("I am a trace log.");
114
114
logger.debug("I am a debug log.");
@@ -148,7 +148,7 @@ Every incoming log message runs through a number of steps before being displayed
148
148
149
149
-**log message** Log message comes in through the `BaseLogger.log()` method
150
150
-**mask** If masking is configured, log message gets recursively masked
151
-
-**toLogObj** Log message gets transformed into a log object: A default typed log object can be passed to constructor as a second parameter and will be cloned and enriched with the incoming log parameters. Error properties will be handled accordingly. If there is only one log property, and it's an object, both objects (cloned default `logObj` as well as the log property object will be merged.) If there are more than one, they will be put into properties called "0", "1", ... and so on. Alternatively, log message properties can be put into a property with a name configured with the `argumentsArrayName` setting.
151
+
-**toLogObj** Log message gets transformed into a log object: A default typed log object can be passed to constructor as a second parameter and will be cloned and enriched with the incoming log parameters. Error properties will be handled accordingly. If there is only one log property, and it's an object, both objects (cloned default `logObj` as well as the log property object) will be merged. If there are more than one, they will be put into properties called "0", "1", ... and so on. Alternatively, log message properties can be put into a property with a name configured with the `argumentsArrayName` setting.
152
152
-**addMetaToLogObj** Additional meta information, like the source code position of the log will be gathered and added to the `_meta` property or any other one configured with the setting `metaProperty`.
153
153
-**format** In case of "pretty" configuration, a log object will be formatted based on the templates configured in settings. Meta will be formatted by the method `_prettyFormatLogObjMeta` and the actual log payload will be formatted by `prettyFormatLogObj`. Both steps can be overwritten with the settings `formatMeta` and `formatMeta`.
154
154
-**transport** Last step is to "transport" a log message to every attached transport from the setting `attachedTransports`. Last step is the actual transport, either JSON (`transportJSON`), formatted (`transportFormatted`) or omitted, if its set to "hidden". Both default transports can also be overwritten by the corresponding setting.
@@ -157,7 +157,7 @@ Every incoming log message runs through a number of steps before being displayed
157
157
158
158
`tslog` comes with default log level `0: silly`, `1: trace`, `2: debug`, `3: info`, `4: warn`, `5: error`, `6: fatal`.
159
159
160
-
> **Tip:** Each logging method has a return type, which is a _JSON_ representation of the log message (`ILogObject`).
160
+
> **Tip:** Each logging method has a return type, which is a _JSON_ representation of the log message (`ILogObj`).
0 commit comments