@genesislcap/foundation-logger 14.408.0 → 14.409.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -47
- package/package.json +4 -5
- package/docs/api/foundation-logger.createlogger.md +0 -102
- package/docs/api/foundation-logger.defaultloggeroptions.md +0 -13
- package/docs/api/foundation-logger.logger.deprecated.md +0 -105
- package/docs/api/foundation-logger.logger.md +0 -45
- package/docs/api/foundation-logger.loggeroptions.md +0 -15
- package/docs/api/foundation-logger.md +0 -95
- package/docs/api/index.md +0 -30
- package/docs/api-report.md.api.md +0 -37
package/README.md
CHANGED
|
@@ -1,66 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @genesislcap/foundation-logger
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://www.typescriptlang.org/)
|
|
3
|
+
Documentation for this package is published on the Genesis docs site:
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
**Docs: [Utility methods](https://docs.genesis.global/docs/develop/client-capabilities/utility-methods/)**
|
|
7
6
|
|
|
8
7
|
## Installation
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
1. Add `@genesislcap/foundation-logger` as a dependency in your `package.json` file. Whenever you change the dependencies of your project, ensure you run the `$ npm run bootstrap` command again. You can find more information in the [package.json basics](https://learn.genesis.global/secure/web/basics/package-json-basics/) page.
|
|
9
|
+
Add the package to your `package.json` dependencies. After changing dependencies, run `npm run bootstrap` (or your project's equivalent). See [package.json basics](https://learn.genesis.global/secure/web/basics/package-json-basics/) for more information.
|
|
13
10
|
|
|
14
11
|
```json
|
|
15
12
|
{
|
|
16
|
-
...
|
|
17
13
|
"dependencies": {
|
|
18
|
-
...
|
|
19
14
|
"@genesislcap/foundation-logger": "latest"
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
...
|
|
15
|
+
}
|
|
23
16
|
}
|
|
24
17
|
```
|
|
25
18
|
|
|
26
|
-
2. Create a logger in my-package/utils/logger.ts for example.
|
|
27
|
-
|
|
28
|
-
```ts
|
|
29
|
-
import { createLogger } from '@genesislcap/foundation-logger';
|
|
30
|
-
export const logger = createLogger('my-package');
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
The logger will be set to `LogLevel.Debug` by default, however you can pass options as the second parameter to tailor this.
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
export const logger = createLogger('my-package', { level: LogLevel.Debug, ... });
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
`LoggerOptions` type extends the `ConsolaOptions` type.
|
|
40
|
-
|
|
41
|
-
3. Use the logger in your package.
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
import { logger } from '../utils';
|
|
45
|
-
...
|
|
46
|
-
logger.debug('Checks complete');
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
4. Explicitly set the log level of an imported foundation package when needed.
|
|
50
|
-
|
|
51
|
-
```ts
|
|
52
|
-
import { logger as commsLogger } from '@genesislcap/foundation-comms';
|
|
53
|
-
import { logger as storeLogger } from '@genesislcap/foundation-store';
|
|
54
|
-
import { LogLevel } from '@genesislcap/foundation-logger';
|
|
55
|
-
commsLogger.level = LogLevel.Warn;
|
|
56
|
-
storeLogger.level = LogLevel.Silent;
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## [API Docs](./docs/api/index.md)
|
|
60
|
-
|
|
61
19
|
## License
|
|
62
20
|
|
|
63
21
|
Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact [Genesis Global](https://genesis.global/contact-us/) for more details.
|
|
64
22
|
|
|
65
23
|
### Licensed components
|
|
24
|
+
|
|
66
25
|
Genesis low-code platform
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-logger",
|
|
3
3
|
"description": "Genesis Foundation Logger",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.409.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
8
8
|
"types": "dist/dts/index.d.ts",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"api:extract": "api-extractor run",
|
|
11
|
-
"
|
|
12
|
-
"build": "npm run clean && tsc -b ./tsconfig.json && npm run api:extract && npm run api:document",
|
|
11
|
+
"build": "npm run clean && tsc -b ./tsconfig.json && npm run api:extract",
|
|
13
12
|
"circular": "npx -y madge --extensions ts --circular ./src",
|
|
14
13
|
"clean": "rimraf dist temp tsconfig.tsbuildinfo",
|
|
15
|
-
"dev": "
|
|
14
|
+
"dev": "genx dev -b ts",
|
|
16
15
|
"lint": "genx lint --profile",
|
|
17
16
|
"lint:fix": "genx lint --fix"
|
|
18
17
|
},
|
|
@@ -34,5 +33,5 @@
|
|
|
34
33
|
"publishConfig": {
|
|
35
34
|
"access": "public"
|
|
36
35
|
},
|
|
37
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "cbe0459d170f27c35a7de18cec415947aedf4da5"
|
|
38
37
|
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-logger](./foundation-logger.md) > [createLogger](./foundation-logger.createlogger.md)
|
|
4
|
-
|
|
5
|
-
## createLogger() function
|
|
6
|
-
|
|
7
|
-
Creates a logger with the given name and options.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare function createLogger(name: string, options?: LoggerOptions): Logger;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
name
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
string
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
The name to give the logger.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
<tr><td>
|
|
50
|
-
|
|
51
|
-
options
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</td><td>
|
|
55
|
-
|
|
56
|
-
[LoggerOptions](./foundation-logger.loggeroptions.md)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
_(Optional)_ The options to use when creating the logger.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</td></tr>
|
|
65
|
-
</tbody></table>
|
|
66
|
-
|
|
67
|
-
**Returns:**
|
|
68
|
-
|
|
69
|
-
[Logger](./foundation-logger.logger.md)
|
|
70
|
-
|
|
71
|
-
The resulting logger.
|
|
72
|
-
|
|
73
|
-
## Example 1
|
|
74
|
-
|
|
75
|
-
Create a logger in my-package/utils.
|
|
76
|
-
|
|
77
|
-
```ts
|
|
78
|
-
import { createLogger } from '@genesislcap/foundation-logger';
|
|
79
|
-
export const logger = createLogger('my-package');
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Example 2
|
|
83
|
-
|
|
84
|
-
Using the logger within my-package.
|
|
85
|
-
|
|
86
|
-
```ts
|
|
87
|
-
import { logger } from '../utils';
|
|
88
|
-
logger.debug(`Data retrieved from ${resourceName}`);
|
|
89
|
-
logger.info(this.toggled ? 'On' : 'Off');
|
|
90
|
-
logger.warn('Not available in this browser.');
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Example 3
|
|
94
|
-
|
|
95
|
-
Explicitly set the level of an imported package.
|
|
96
|
-
|
|
97
|
-
```ts
|
|
98
|
-
import { logger as commsLogger } from '@genesislcap/foundation-comms';
|
|
99
|
-
import { LogLevel } from '@genesislcap/foundation-logger';
|
|
100
|
-
commsLogger.level = LogLevel.Warn;
|
|
101
|
-
```
|
|
102
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-logger](./foundation-logger.md) > [defaultLoggerOptions](./foundation-logger.defaultloggeroptions.md)
|
|
4
|
-
|
|
5
|
-
## defaultLoggerOptions variable
|
|
6
|
-
|
|
7
|
-
The default logger options.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
defaultLoggerOptions: LoggerOptions
|
|
13
|
-
```
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-logger](./foundation-logger.md) > [Logger](./foundation-logger.logger.md) > [deprecated](./foundation-logger.logger.deprecated.md)
|
|
4
|
-
|
|
5
|
-
## Logger.deprecated() method
|
|
6
|
-
|
|
7
|
-
A logger method for deprecated symbols.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
deprecated(symbol: string, instruction?: string, removalVersionTarget?: string): void;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
symbol
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
string
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
The deprecated symbol.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
<tr><td>
|
|
50
|
-
|
|
51
|
-
instruction
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</td><td>
|
|
55
|
-
|
|
56
|
-
string
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
_(Optional)_ An optional alternative instruction. Defaults to `Consult docs for better alternative.`
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</td></tr>
|
|
65
|
-
<tr><td>
|
|
66
|
-
|
|
67
|
-
removalVersionTarget
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</td><td>
|
|
71
|
-
|
|
72
|
-
string
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</td><td>
|
|
76
|
-
|
|
77
|
-
_(Optional)_ An optional target removal version number.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</td></tr>
|
|
81
|
-
</tbody></table>
|
|
82
|
-
|
|
83
|
-
**Returns:**
|
|
84
|
-
|
|
85
|
-
void
|
|
86
|
-
|
|
87
|
-
## Remarks
|
|
88
|
-
|
|
89
|
-
Pair with a deprecated tag. See [https://tsdoc.org/pages/tags/deprecated/](https://tsdoc.org/pages/tags/deprecated/) for more information.
|
|
90
|
-
|
|
91
|
-
## Example 1
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
```ts
|
|
95
|
-
logger.deprecated('someSymbol');
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Example 2
|
|
99
|
-
|
|
100
|
-
With a custom instruction and target removal version.
|
|
101
|
-
|
|
102
|
-
```ts
|
|
103
|
-
logger.deprecated('routeButtons', 'Use the default slot instead.', '20.0.0');
|
|
104
|
-
```
|
|
105
|
-
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-logger](./foundation-logger.md) > [Logger](./foundation-logger.logger.md)
|
|
4
|
-
|
|
5
|
-
## Logger interface
|
|
6
|
-
|
|
7
|
-
A logger that extends the `Consola` logger.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export interface Logger extends Consola
|
|
13
|
-
```
|
|
14
|
-
**Extends:** Consola
|
|
15
|
-
|
|
16
|
-
## Remarks
|
|
17
|
-
|
|
18
|
-
This logger is part of the package's API but may still be subject to changes and improvements.
|
|
19
|
-
|
|
20
|
-
## Methods
|
|
21
|
-
|
|
22
|
-
<table><thead><tr><th>
|
|
23
|
-
|
|
24
|
-
Method
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
[deprecated(symbol, instruction, removalVersionTarget)](./foundation-logger.logger.deprecated.md)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
A logger method for deprecated symbols.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td></tr>
|
|
44
|
-
</tbody></table>
|
|
45
|
-
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-logger](./foundation-logger.md) > [LoggerOptions](./foundation-logger.loggeroptions.md)
|
|
4
|
-
|
|
5
|
-
## LoggerOptions interface
|
|
6
|
-
|
|
7
|
-
Options for creating a logger.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export interface LoggerOptions extends ConsolaOptions
|
|
13
|
-
```
|
|
14
|
-
**Extends:** ConsolaOptions
|
|
15
|
-
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-logger](./foundation-logger.md)
|
|
4
|
-
|
|
5
|
-
## foundation-logger package
|
|
6
|
-
|
|
7
|
-
## Functions
|
|
8
|
-
|
|
9
|
-
<table><thead><tr><th>
|
|
10
|
-
|
|
11
|
-
Function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</th><th>
|
|
15
|
-
|
|
16
|
-
Description
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</th></tr></thead>
|
|
20
|
-
<tbody><tr><td>
|
|
21
|
-
|
|
22
|
-
[createLogger(name, options)](./foundation-logger.createlogger.md)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</td><td>
|
|
26
|
-
|
|
27
|
-
Creates a logger with the given name and options.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</td></tr>
|
|
31
|
-
</tbody></table>
|
|
32
|
-
|
|
33
|
-
## Interfaces
|
|
34
|
-
|
|
35
|
-
<table><thead><tr><th>
|
|
36
|
-
|
|
37
|
-
Interface
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</th><th>
|
|
41
|
-
|
|
42
|
-
Description
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</th></tr></thead>
|
|
46
|
-
<tbody><tr><td>
|
|
47
|
-
|
|
48
|
-
[Logger](./foundation-logger.logger.md)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
</td><td>
|
|
52
|
-
|
|
53
|
-
A logger that extends the `Consola` logger.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</td></tr>
|
|
57
|
-
<tr><td>
|
|
58
|
-
|
|
59
|
-
[LoggerOptions](./foundation-logger.loggeroptions.md)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</td><td>
|
|
63
|
-
|
|
64
|
-
Options for creating a logger.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</td></tr>
|
|
68
|
-
</tbody></table>
|
|
69
|
-
|
|
70
|
-
## Variables
|
|
71
|
-
|
|
72
|
-
<table><thead><tr><th>
|
|
73
|
-
|
|
74
|
-
Variable
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</th><th>
|
|
78
|
-
|
|
79
|
-
Description
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</th></tr></thead>
|
|
83
|
-
<tbody><tr><td>
|
|
84
|
-
|
|
85
|
-
[defaultLoggerOptions](./foundation-logger.defaultloggeroptions.md)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
</td><td>
|
|
89
|
-
|
|
90
|
-
The default logger options.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</td></tr>
|
|
94
|
-
</tbody></table>
|
|
95
|
-
|
package/docs/api/index.md
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md)
|
|
4
|
-
|
|
5
|
-
## API Reference
|
|
6
|
-
|
|
7
|
-
## Packages
|
|
8
|
-
|
|
9
|
-
<table><thead><tr><th>
|
|
10
|
-
|
|
11
|
-
Package
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</th><th>
|
|
15
|
-
|
|
16
|
-
Description
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</th></tr></thead>
|
|
20
|
-
<tbody><tr><td>
|
|
21
|
-
|
|
22
|
-
[@genesislcap/foundation-logger](./foundation-logger.md)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</td><td>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</td></tr>
|
|
29
|
-
</tbody></table>
|
|
30
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
## API Report File for "@genesislcap/foundation-logger"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { Consola } from 'consola';
|
|
8
|
-
import { ConsolaOptions } from 'consola';
|
|
9
|
-
import { LogLevel } from 'consola';
|
|
10
|
-
import { logType } from 'consola';
|
|
11
|
-
|
|
12
|
-
// @public
|
|
13
|
-
export function createLogger(name: string, options?: LoggerOptions): Logger;
|
|
14
|
-
|
|
15
|
-
// @public
|
|
16
|
-
export const defaultLoggerOptions: LoggerOptions;
|
|
17
|
-
|
|
18
|
-
// @public
|
|
19
|
-
export interface Logger extends Consola {
|
|
20
|
-
deprecated(symbol: string, instruction?: string, removalVersionTarget?: string): void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// @public
|
|
24
|
-
export interface Logger extends Consola {
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// @public
|
|
28
|
-
export interface LoggerOptions extends ConsolaOptions {
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { LogLevel }
|
|
32
|
-
|
|
33
|
-
export { logType }
|
|
34
|
-
|
|
35
|
-
// (No @packageDocumentation comment for this package)
|
|
36
|
-
|
|
37
|
-
```
|