Update README
This commit is contained in:
16
README.md
16
README.md
@@ -15,6 +15,7 @@ Disable a source:
|
|||||||
log.visible = false;
|
log.visible = false;
|
||||||
|
|
||||||
log.debug("I can't be seen!");
|
log.debug("I can't be seen!");
|
||||||
|
|
||||||
// no output
|
// no output
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -29,4 +30,19 @@ log.n("Something happened");
|
|||||||
// output:
|
// output:
|
||||||
// 2024-11-14T01:21:40.350Z Main [NETWORK] Network is networking
|
// 2024-11-14T01:21:40.350Z Main [NETWORK] Network is networking
|
||||||
// 2024-11-14T01:21:40.350Z Main2 [NETWORK] Something happened
|
// 2024-11-14T01:21:40.350Z Main2 [NETWORK] Something happened
|
||||||
|
```
|
||||||
|
|
||||||
|
Disable a type of message globally:
|
||||||
|
```ts
|
||||||
|
import Logging, { MessageTypeVisibility } from "./mod.ts";
|
||||||
|
// .. logging source "Main" is in the scope
|
||||||
|
|
||||||
|
MessageTypeVisibility.Error = false;
|
||||||
|
|
||||||
|
// somewhere else, could be a different script
|
||||||
|
log.i("I am visible");
|
||||||
|
log.error("I am not visible");
|
||||||
|
|
||||||
|
// output:
|
||||||
|
// 2024-11-14T01:21:40.350Z Main [INFO] I am visible
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user