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
{{ message }}
This repository was archived by the owner on Feb 15, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/Interfaces.md
+1-159Lines changed: 1 addition & 159 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
id: interfaces
3
3
title: Interfaces
4
-
sidebar_label: Interfaces
4
+
sidebar_label: INTERFACES
5
5
slug: /interfaces
6
6
---
7
7
@@ -14,164 +14,6 @@ You might get redirected to parts of the Interface Section from other documentat
14
14
15
15
:::
16
16
17
-
## `CreateLoggerConfig`
18
-
19
-
The `CreateLoggerConfigInterface` is used in the creation and configuration of the [Agile `Logger Class`](packages/core/api/agile-instance/Properties.md#logger).
20
-
Here is a Typescript Interface for quick reference. However,
21
-
each property is explained in more detail below.
22
-
```ts
23
-
exportinterfaceCreateLoggerConfigInterface {
24
-
prefix?:string;
25
-
allowedTags?:string[];
26
-
canUseCustomStyles?:boolean;
27
-
active?:boolean;
28
-
level?:number;
29
-
timestamp?:boolean;
30
-
}
31
-
```
32
-
33
-
<br/>
34
-
35
-
#### `prefix`
36
-
37
-
Prefix which is added before each log message.
38
-
```ts {2}
39
-
const logger =newLogger({
40
-
prefix: "MyLog"
41
-
});
42
-
43
-
logger.debug("Jeff"); // Logs 'MyLog Debug: Jeff'
44
-
```
45
-
The log messages of AgileTs have the default prefix "Agile".
46
-
47
-
| Type | Default | Required |
48
-
|--------------------|-----------|----------|
49
-
|`string`| "Agile" | No |
50
-
51
-
<br/>
52
-
53
-
#### `level`
54
-
55
-
The `log level` controls which kind of log messages are allowed to be logged.
56
-
Therefore, it is used to filter log messages to only see these relevant to us.
57
-
For example, we won't often set the `log level` to `debug`
58
-
since debug messages flood the console and are, in most cases, not relevant for us.
59
-
```ts {2}
60
-
const logger =newLogger({
61
-
level: Logger.level.WARN
62
-
});
63
-
64
-
logger.debug("Jeff"); // Doesn't get logged
65
-
logger.warn("A important Warning"); // Gets logged
66
-
```
67
-
The `Logger Class` supports some hard-coded log levels, which can be set dynamically.
68
-
```ts
69
-
{
70
-
TRACE: 1,
71
-
DEBUG: 2,
72
-
LOG: 5,
73
-
TABLE: 5,
74
-
INFO: 10,
75
-
SUCCESS: 15,
76
-
WARN: 20,
77
-
ERROR: 50,
78
-
}
79
-
80
-
Logger.level.LOG; // 5
81
-
```
82
-
For example, suppose we set the logger level to `INFO`. In that case,
83
-
each log category at a higher or same level is printed to the console.
84
-
In the case of `INFO`, that would be `SUCCESS`, `WARN`, `ERROR` and of course `INFO`.
85
-
86
-
| Type | Default | Required |
87
-
|--------------------|-----------|----------|
88
-
|`number`| 20 | No |
89
-
90
-
<br/>
91
-
92
-
#### `active`
93
-
94
-
Determines whether the logger is `active` and is allowed to print messages to the console.
95
-
```ts {2}
96
-
const logger =newLogger({
97
-
active: false
98
-
});
99
-
100
-
logger.log("Jeff"); // Doesn't get logged
101
-
logger.isActive=true;
102
-
logger.log("Jeff"); // Gets logged
103
-
```
104
-
105
-
| Type | Default | Required |
106
-
|--------------------|-----------|----------|
107
-
|`boolean`| true | No |
108
-
109
-
<br/>
110
-
111
-
#### `timestamp`
112
-
113
-
If `true`, a timestamp is added before each log message.
114
-
This timestamp represents the time the message was logged.
The `StateIngestConfigInterface` is used as configuration object in functions like [`set()`](packages/core/api/state/Methods.md#set) or [`undo()`](packages/core/api/state/Methods.md#undo).
0 commit comments