Update README

This commit is contained in:
2024-11-16 13:39:10 -05:00
parent b24f819d85
commit df15f608ed

View File

@@ -15,6 +15,7 @@ Disable a source:
log.visible = false;
log.debug("I can't be seen!");
// no output
```
@@ -30,3 +31,18 @@ log.n("Something happened");
// 2024-11-14T01:21:40.350Z Main [NETWORK] Network is networking
// 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
```