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: log4ts-style/README.MD
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,9 +137,12 @@ A logger can log on different `LogLevels`:
137
137
- Warn
138
138
- Error
139
139
- Fatal
140
+
- Off
140
141
141
-
Each level has a matching function on the Logger, for example `trace` for Trace and `debug` for Debug. The signatures of
142
-
the function are the same for all of them. This shows the signatures for debug.
142
+
Each level except 'Off' has a matching function on the Logger, for example `trace` for Trace and `debug` for Debug. The
143
+
signatures of the function are the same for all of them. Note that the level 'Off' turns logging off completely.
144
+
145
+
This shows the signatures for debug.
143
146
144
147
```typescript
145
148
interfaceCoreLogger {
@@ -177,7 +180,8 @@ A Log4TSProvider created without any options logs on `LogLevel.Error` and uses a
177
180
console. Messages are formatted in a default sane format (see above for an example).
178
181
179
182
This code snippet creates a Log4TSProvider with default settings, the `groups` property is required to be specified and
180
-
in this case we match every namespace. Note we also specify an identifier, it is recommended to specify the identifier if
183
+
in this case we match every namespace. Note we also specify an identifier, it is recommended to specify the identifier
184
+
if
181
185
you intend to make use of the dynamic control (see in later sections).
182
186
183
187
```typescript
@@ -302,7 +306,9 @@ export interface LogChannel {
302
306
}
303
307
```
304
308
305
-
Essentially it expects you to provide the `write` function. The `type` (a [discriminating union](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions)) is solely there to
309
+
Essentially it expects you to provide the `write` function. The `type` (
310
+
a [discriminating union](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions)) is solely
311
+
there to
306
312
distinguish between the different channels and is always `"LogChannel"` for a `LogChannel`. The write function is called
307
313
with for each `LogMessage`, and contains a message and optional error (formatted as stack). We have
308
314
already seen how to create a custom LogChannel in the previous section (have a look above if you didn't read it yet).
0 commit comments