@o3r/logger 14.0.0-prerelease.3 → 14.0.0-prerelease.30
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 +19 -26
- package/fesm2022/o3r-logger.mjs +2 -41
- package/fesm2022/o3r-logger.mjs.map +1 -1
- package/package.json +4 -4
- package/types/o3r-logger.d.ts +2 -17
- package/types/o3r-logger.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ ng add @o3r/logger
|
|
|
25
25
|
|
|
26
26
|
## Setup
|
|
27
27
|
|
|
28
|
-
The
|
|
28
|
+
The logger should be provided in the main module of the application and an instance of a `LoggerClient` implementation bound through the `provideLogger` function.
|
|
29
29
|
|
|
30
30
|
```typescript
|
|
31
31
|
// in app-module.ts
|
|
@@ -33,14 +33,14 @@ The `LoggerModule` should be imported in the main Module of the application and
|
|
|
33
33
|
import {LogRocketClient} from '@o3r/logger/logrocket-logger-client';
|
|
34
34
|
// import {SmartLookClient} from '@o3r/logger/smartlook-logger-client';
|
|
35
35
|
// import {FullStoryClient} from '@o3r/logger/fullstory-logger-client';
|
|
36
|
-
import {
|
|
36
|
+
import {provideLogger} from '@o3r/logger';
|
|
37
37
|
|
|
38
38
|
// ...
|
|
39
39
|
|
|
40
40
|
@NgModule({
|
|
41
|
-
|
|
41
|
+
providers: [
|
|
42
42
|
// ...
|
|
43
|
-
|
|
43
|
+
provideLogger(
|
|
44
44
|
new LogRocketClient('LogRocket appId')
|
|
45
45
|
// new SmartLookClient('SmartLook key')
|
|
46
46
|
// new FullStoryClient('FullStory orgId')
|
|
@@ -57,7 +57,7 @@ The store can also be bound to the third-party logging service by using the `Log
|
|
|
57
57
|
// in app-module.ts
|
|
58
58
|
|
|
59
59
|
import {Action, MetaReducer, USER_PROVIDED_META_REDUCERS} from '@ngrx/store';
|
|
60
|
-
import {
|
|
60
|
+
import {LoggerService} from '@o3r/logger';
|
|
61
61
|
|
|
62
62
|
// ...
|
|
63
63
|
|
|
@@ -83,43 +83,39 @@ To provide complex logger client, the client can be provided via the `LOGGER_CLI
|
|
|
83
83
|
|
|
84
84
|
```typescript
|
|
85
85
|
import {LogRocketClient} from '@o3r/logger/logrocket-logger-client';
|
|
86
|
-
import {LOGGER_CLIENT_TOKEN,
|
|
86
|
+
import {LOGGER_CLIENT_TOKEN, LoggerService} from '@o3r/logger';
|
|
87
87
|
|
|
88
88
|
// ...
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
imports: [
|
|
92
|
-
LoggerModule
|
|
93
|
-
],
|
|
90
|
+
export const appConfig: ApplicationConfig = {
|
|
94
91
|
providers: [
|
|
92
|
+
LoggerService,
|
|
95
93
|
{ provide: LOGGER_CLIENT_TOKEN, useValue: new LogRocketClient('LogRocket appId') }
|
|
96
94
|
]
|
|
97
|
-
}
|
|
98
|
-
export class AppModule {}
|
|
95
|
+
}
|
|
99
96
|
```
|
|
100
97
|
|
|
101
98
|
### Multi Client
|
|
102
99
|
|
|
103
100
|
The Logger service supports multi logger clients.
|
|
104
|
-
This can be provided via the
|
|
101
|
+
This can be provided via the `provideLogger` function as follows:
|
|
105
102
|
|
|
106
103
|
```typescript
|
|
107
104
|
import {LogRocketClient} from '@o3r/logger/logrocket-logger-client';
|
|
108
105
|
import {SmartLookClient} from '@o3r/logger/smartlook-logger-client';
|
|
109
|
-
import {
|
|
106
|
+
import {provideLogger} from '@o3r/logger';
|
|
110
107
|
|
|
111
108
|
// ...
|
|
112
109
|
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
export const config: ApplicationConfig = {
|
|
111
|
+
providers: [
|
|
115
112
|
// ...
|
|
116
|
-
|
|
113
|
+
provideLogger(
|
|
117
114
|
new LogRocketClient('LogRocket appId'),
|
|
118
115
|
new SmartLookClient('SmartLook key')
|
|
119
116
|
)
|
|
120
117
|
]
|
|
121
|
-
}
|
|
122
|
-
export class AppModule {}
|
|
118
|
+
};
|
|
123
119
|
```
|
|
124
120
|
|
|
125
121
|
Or via multi providers:
|
|
@@ -127,18 +123,15 @@ Or via multi providers:
|
|
|
127
123
|
```typescript
|
|
128
124
|
import {LogRocketClient} from '@o3r/logger/logrocket-logger-client';
|
|
129
125
|
import {SmartLookClient} from '@o3r/logger/smartlook-logger-client';
|
|
130
|
-
import {LOGGER_CLIENT_TOKEN,
|
|
126
|
+
import {LOGGER_CLIENT_TOKEN, LoggerService} from '@o3r/logger';
|
|
131
127
|
|
|
132
|
-
|
|
133
|
-
imports: [
|
|
134
|
-
LoggerModule
|
|
135
|
-
],
|
|
128
|
+
export const appConfig: ApplicationConfig = {
|
|
136
129
|
providers: [
|
|
130
|
+
LoggerService,
|
|
137
131
|
{ provide: LOGGER_CLIENT_TOKEN, useValue: new LogRocketClient('LogRocket appId'), multi: true },
|
|
138
132
|
{ provide: LOGGER_CLIENT_TOKEN, useValue: new SmartLookClient('SmartLook key'), multi: true }
|
|
139
133
|
]
|
|
140
|
-
}
|
|
141
|
-
export class AppModule {}
|
|
134
|
+
}
|
|
142
135
|
```
|
|
143
136
|
|
|
144
137
|
## How to use
|
package/fesm2022/o3r-logger.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable,
|
|
2
|
+
import { InjectionToken, inject, Injectable, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Console logger used to display the logs in the browser console
|
|
@@ -180,45 +180,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
180
180
|
}]
|
|
181
181
|
}], ctorParameters: () => [] });
|
|
182
182
|
|
|
183
|
-
/**
|
|
184
|
-
* @deprecated will be removed in v14.
|
|
185
|
-
*/
|
|
186
|
-
class LoggerModule {
|
|
187
|
-
/**
|
|
188
|
-
* Provide logger at application level
|
|
189
|
-
* By default {@link ConsoleLogger} will be used if nothing is specified
|
|
190
|
-
* @param {...LoggerClient[]} clients Registered {@link https://github.com/AmadeusITGroup/otter/blob/main/docs/logger/LOGS.md | Logger Client}
|
|
191
|
-
* @deprecated Please use {@link provideLogger} instead, will be removed in v14.
|
|
192
|
-
*/
|
|
193
|
-
static forRoot(...clients) {
|
|
194
|
-
if (clients.length === 0) {
|
|
195
|
-
clients = [new ConsoleLogger()];
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
ngModule: LoggerModule,
|
|
199
|
-
providers: [
|
|
200
|
-
{
|
|
201
|
-
provide: LOGGER_CLIENT_TOKEN,
|
|
202
|
-
useValue: clients,
|
|
203
|
-
multi: false
|
|
204
|
-
}
|
|
205
|
-
]
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LoggerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
209
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: LoggerModule }); }
|
|
210
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LoggerModule, providers: [
|
|
211
|
-
LoggerService
|
|
212
|
-
] }); }
|
|
213
|
-
}
|
|
214
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LoggerModule, decorators: [{
|
|
215
|
-
type: NgModule,
|
|
216
|
-
args: [{
|
|
217
|
-
providers: [
|
|
218
|
-
LoggerService
|
|
219
|
-
]
|
|
220
|
-
}]
|
|
221
|
-
}] });
|
|
222
183
|
/**
|
|
223
184
|
* Provide logger for the application
|
|
224
185
|
* By default {@link ConsoleLogger} will be used if nothing is specified
|
|
@@ -260,5 +221,5 @@ const noopLogger = {
|
|
|
260
221
|
* Generated bundle index. Do not edit.
|
|
261
222
|
*/
|
|
262
223
|
|
|
263
|
-
export { ConsoleLogger, LOGGER_CLIENT_TOKEN,
|
|
224
|
+
export { ConsoleLogger, LOGGER_CLIENT_TOKEN, LoggerService, noopLogger, provideLogger };
|
|
264
225
|
//# sourceMappingURL=o3r-logger.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-logger.mjs","sources":["../../src/services/logger/logger-console.ts","../../src/services/logger/logger-token.ts","../../src/services/logger/logger-service.ts","../../src/services/logger/logger-module.ts","../../src/services/logger/logger-noop.ts","../../src/o3r-logger.ts"],"sourcesContent":["/* eslint-disable no-console -- this is the purpose of this logger */\nimport {\n Action,\n ActionReducer,\n MetaReducer,\n} from '@ngrx/store';\nimport type {\n LoggerClient,\n} from './logger-client';\n\n/**\n * Console logger used to display the logs in the browser console\n * Should be used in development mode.\n */\nexport class ConsoleLogger implements LoggerClient {\n /** @inheritdoc */\n public error = console.error;\n\n /** @inheritdoc */\n public warn = console.warn;\n\n /** @inheritdoc */\n public debug = console.debug;\n\n /** @inheritdoc */\n public info = console.info;\n\n /** @inheritdoc */\n public log = console.log;\n\n /** @inheritdoc */\n public identify(uuid: string) {\n this.debug('logging identify function called');\n this.log(`Identify user id ${uuid}`);\n }\n\n /** @inheritdoc */\n public event(name: string, properties?: any) {\n this.debug('logging event function called');\n this.log('event:', name);\n if (properties) {\n this.log('properties:', properties);\n }\n }\n\n /** @inheritdoc */\n public getSessionURL(): undefined {\n this.debug('logging getSessionURL function called');\n return undefined;\n }\n\n /** @inheritdoc */\n public stopRecording() {\n this.debug('logging stopRecording function called');\n }\n\n /** @inheritdoc */\n public resumeRecording() {\n this.debug('logging resumeRecording function called');\n }\n\n /** @inheritdoc */\n public createMetaReducer(): MetaReducer<any, Action> {\n this.debug('logging createMetaReducer function called but a noop reducer is returned for the console logger');\n return (reducer: ActionReducer<any>): ActionReducer<any> => reducer;\n }\n}\n","import {\n InjectionToken,\n} from '@angular/core';\nimport {\n LoggerClient,\n} from './logger-client';\n\nexport const LOGGER_CLIENT_TOKEN: InjectionToken<LoggerClient | LoggerClient[]> = new InjectionToken('Logger Client injection token');\n","import {\n inject,\n Injectable,\n} from '@angular/core';\nimport {\n Action,\n MetaReducer,\n} from '@ngrx/store';\nimport type {\n Logger,\n} from '@o3r/core';\nimport {\n LoggerClient,\n} from './logger-client';\nimport {\n ConsoleLogger,\n} from './logger-console';\nimport {\n LOGGER_CLIENT_TOKEN,\n} from './logger-token';\n\n/**\n * Logger service\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class LoggerService implements Logger {\n /** Loggers */\n private readonly clients: LoggerClient[];\n\n /**\n * Record the recording status to make sure that new clients recording status will be consistent with the service\n */\n private recordingState: 'default' | 'resumed' | 'stopped' = 'default';\n\n constructor() {\n const clients = inject<LoggerClient | LoggerClient[]>(LOGGER_CLIENT_TOKEN, { optional: true });\n\n this.clients = clients ? (Array.isArray(clients) ? clients : [clients]) : [new ConsoleLogger()];\n }\n\n /**\n * Identify a user.\n * @param uid Unique identifier for the current user\n * @param vars Addition information about the user\n */\n public identify(uid: string, vars?: { [key: string]: string }) {\n this.clients.forEach((client) => client.identify(uid, vars));\n }\n\n /**\n * Log custom event.\n * @param name Name of the event to log\n * @param properties Additional properties\n */\n public event(name: string, properties?: any): void {\n this.clients.forEach((client) => client.event(name, properties));\n }\n\n /**\n * Generate a link to the replay of the current session.\n */\n public getClientSessionURL(): string | string[] | undefined {\n const sessionUrls = this.clients\n .map((client) => client.getSessionURL())\n .filter((sessionUrl): sessionUrl is string => !!sessionUrl);\n return sessionUrls.length <= 1 ? sessionUrls[0] : sessionUrls;\n }\n\n /**\n * Register a new client to the logger service\n * @param client\n */\n public registerClient(client: LoggerClient) {\n if (this.clients.includes(client)) {\n this.warn(`Client ${client.constructor.name} already registered`);\n return;\n }\n if (this.recordingState === 'resumed') {\n client.resumeRecording();\n } else if (this.recordingState === 'stopped') {\n client.stopRecording();\n }\n this.clients.push(client);\n }\n\n /**\n * Stop recording.\n */\n public stopClientRecording(): void {\n this.recordingState = 'stopped';\n this.clients.forEach((client) => client.stopRecording());\n }\n\n /**\n * Resume recording.\n */\n public resumeClientRecording(): void {\n this.recordingState = 'resumed';\n this.clients.forEach((client) => client.resumeRecording());\n }\n\n /**\n * Report an error\n * @param message\n * @param optionalParams\n */\n public error(message?: any, ...optionalParams: any[]) {\n this.clients.forEach((client) => client.error(message, ...optionalParams));\n }\n\n /**\n * Report a warning\n * @param message\n * @param optionalParams\n */\n public warn(message?: any, ...optionalParams: any[]) {\n this.clients.forEach((client) => client.warn(message, ...optionalParams));\n }\n\n /**\n * Log a message\n * @param message\n * @param optionalParams\n */\n public log(message?: any, ...optionalParams: any[]) {\n this.clients.forEach((client) => client.log(message, ...optionalParams));\n }\n\n /**\n * Log a message\n * @param message\n * @param optionalParams\n */\n public info(message?: any, ...optionalParams: any[]): void {\n this.clients.forEach((client) => (client.info ? client.info(message, ...optionalParams) : client.log(message, ...optionalParams)));\n }\n\n /**\n * Log a debug message\n * @param message\n * @param optionalParams\n */\n public debug(message?: any, ...optionalParams: any[]) {\n this.clients.forEach((client) => client.debug?.(message, ...optionalParams));\n }\n\n /**\n * Create a meta reducer to log ngrx store.\n */\n public createMetaReducer(): MetaReducer<any, Action> | MetaReducer<any, Action>[] | undefined {\n const metaReducers = this.clients\n .map((client) => client.createMetaReducer())\n .filter((metaReducer): metaReducer is MetaReducer<any, Action> => !!metaReducer);\n return metaReducers.length <= 1 ? metaReducers[0] : metaReducers;\n }\n}\n","import {\n makeEnvironmentProviders,\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport {\n LoggerClient,\n} from './logger-client';\nimport {\n ConsoleLogger,\n} from './logger-console';\nimport {\n LoggerService,\n} from './logger-service';\nimport {\n LOGGER_CLIENT_TOKEN,\n} from './logger-token';\n\n/**\n * @deprecated will be removed in v14.\n */\n@NgModule({\n providers: [\n LoggerService\n ]\n})\nexport class LoggerModule {\n /**\n * Provide logger at application level\n * By default {@link ConsoleLogger} will be used if nothing is specified\n * @param {...LoggerClient[]} clients Registered {@link https://github.com/AmadeusITGroup/otter/blob/main/docs/logger/LOGS.md | Logger Client}\n * @deprecated Please use {@link provideLogger} instead, will be removed in v14.\n */\n public static forRoot(...clients: LoggerClient[]): ModuleWithProviders<LoggerModule> {\n if (clients.length === 0) {\n clients = [new ConsoleLogger()];\n }\n return {\n ngModule: LoggerModule,\n providers: [\n {\n provide: LOGGER_CLIENT_TOKEN,\n useValue: clients,\n multi: false\n }\n ]\n };\n }\n}\n\n/**\n * Provide logger for the application\n * By default {@link ConsoleLogger} will be used if nothing is specified\n * @param clients Registered {@link https://github.com/AmadeusITGroup/otter/blob/main/docs/logger/LOGS.md | Logger Client}\n */\nexport function provideLogger(...clients: LoggerClient[]) {\n if (clients.length === 0) {\n clients = [new ConsoleLogger()];\n }\n return makeEnvironmentProviders([\n LoggerService,\n {\n provide: LOGGER_CLIENT_TOKEN,\n useValue: clients,\n multi: false\n }\n ]);\n}\n","/* eslint-disable no-console -- this is the purpose of this logger */\nimport type {\n Action,\n ActionReducer,\n MetaReducer,\n} from '@ngrx/store';\nimport type {\n LoggerClient,\n} from './logger-client';\n\n/**\n * Console logger used to display the logs in the browser console\n * Should be used in development mode.\n */\nexport const noopLogger: Readonly<LoggerClient> = {\n identify: () => {},\n event: () => {},\n getSessionURL: () => undefined,\n stopRecording: () => {},\n resumeRecording: () => {},\n error: console.error,\n warn: console.warn,\n debug: console.debug,\n info: console.info,\n log: console.log,\n createMetaReducer: (): MetaReducer<any, Action> => (reducer: ActionReducer<any>): ActionReducer<any> => reducer\n} as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;AAUA;;;AAGG;MACU,aAAa,CAAA;AAA1B,IAAA,WAAA,GAAA;;AAES,QAAA,IAAA,CAAA,KAAK,GAAG,OAAO,CAAC,KAAK;;AAGrB,QAAA,IAAA,CAAA,IAAI,GAAG,OAAO,CAAC,IAAI;;AAGnB,QAAA,IA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;IACzB,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,GAAG,EAAE,OAAO,CAAC,GAAG;IAChB,iBAAiB,EAAE,MAAgC,CAAC,OAA2B,KAAyB;;;ACzB1G;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"o3r-logger.mjs","sources":["../../src/services/logger/logger-console.ts","../../src/services/logger/logger-token.ts","../../src/services/logger/logger-service.ts","../../src/services/logger/logger-module.ts","../../src/services/logger/logger-noop.ts","../../src/o3r-logger.ts"],"sourcesContent":["/* eslint-disable no-console -- this is the purpose of this logger */\nimport {\n Action,\n ActionReducer,\n MetaReducer,\n} from '@ngrx/store';\nimport type {\n LoggerClient,\n} from './logger-client';\n\n/**\n * Console logger used to display the logs in the browser console\n * Should be used in development mode.\n */\nexport class ConsoleLogger implements LoggerClient {\n /** @inheritdoc */\n public error = console.error;\n\n /** @inheritdoc */\n public warn = console.warn;\n\n /** @inheritdoc */\n public debug = console.debug;\n\n /** @inheritdoc */\n public info = console.info;\n\n /** @inheritdoc */\n public log = console.log;\n\n /** @inheritdoc */\n public identify(uuid: string) {\n this.debug('logging identify function called');\n this.log(`Identify user id ${uuid}`);\n }\n\n /** @inheritdoc */\n public event(name: string, properties?: any) {\n this.debug('logging event function called');\n this.log('event:', name);\n if (properties) {\n this.log('properties:', properties);\n }\n }\n\n /** @inheritdoc */\n public getSessionURL(): undefined {\n this.debug('logging getSessionURL function called');\n return undefined;\n }\n\n /** @inheritdoc */\n public stopRecording() {\n this.debug('logging stopRecording function called');\n }\n\n /** @inheritdoc */\n public resumeRecording() {\n this.debug('logging resumeRecording function called');\n }\n\n /** @inheritdoc */\n public createMetaReducer(): MetaReducer<any, Action> {\n this.debug('logging createMetaReducer function called but a noop reducer is returned for the console logger');\n return (reducer: ActionReducer<any>): ActionReducer<any> => reducer;\n }\n}\n","import {\n InjectionToken,\n} from '@angular/core';\nimport {\n LoggerClient,\n} from './logger-client';\n\nexport const LOGGER_CLIENT_TOKEN: InjectionToken<LoggerClient | LoggerClient[]> = new InjectionToken('Logger Client injection token');\n","import {\n inject,\n Injectable,\n} from '@angular/core';\nimport {\n Action,\n MetaReducer,\n} from '@ngrx/store';\nimport type {\n Logger,\n} from '@o3r/core';\nimport {\n LoggerClient,\n} from './logger-client';\nimport {\n ConsoleLogger,\n} from './logger-console';\nimport {\n LOGGER_CLIENT_TOKEN,\n} from './logger-token';\n\n/**\n * Logger service\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class LoggerService implements Logger {\n /** Loggers */\n private readonly clients: LoggerClient[];\n\n /**\n * Record the recording status to make sure that new clients recording status will be consistent with the service\n */\n private recordingState: 'default' | 'resumed' | 'stopped' = 'default';\n\n constructor() {\n const clients = inject<LoggerClient | LoggerClient[]>(LOGGER_CLIENT_TOKEN, { optional: true });\n\n this.clients = clients ? (Array.isArray(clients) ? clients : [clients]) : [new ConsoleLogger()];\n }\n\n /**\n * Identify a user.\n * @param uid Unique identifier for the current user\n * @param vars Addition information about the user\n */\n public identify(uid: string, vars?: { [key: string]: string }) {\n this.clients.forEach((client) => client.identify(uid, vars));\n }\n\n /**\n * Log custom event.\n * @param name Name of the event to log\n * @param properties Additional properties\n */\n public event(name: string, properties?: any): void {\n this.clients.forEach((client) => client.event(name, properties));\n }\n\n /**\n * Generate a link to the replay of the current session.\n */\n public getClientSessionURL(): string | string[] | undefined {\n const sessionUrls = this.clients\n .map((client) => client.getSessionURL())\n .filter((sessionUrl): sessionUrl is string => !!sessionUrl);\n return sessionUrls.length <= 1 ? sessionUrls[0] : sessionUrls;\n }\n\n /**\n * Register a new client to the logger service\n * @param client\n */\n public registerClient(client: LoggerClient) {\n if (this.clients.includes(client)) {\n this.warn(`Client ${client.constructor.name} already registered`);\n return;\n }\n if (this.recordingState === 'resumed') {\n client.resumeRecording();\n } else if (this.recordingState === 'stopped') {\n client.stopRecording();\n }\n this.clients.push(client);\n }\n\n /**\n * Stop recording.\n */\n public stopClientRecording(): void {\n this.recordingState = 'stopped';\n this.clients.forEach((client) => client.stopRecording());\n }\n\n /**\n * Resume recording.\n */\n public resumeClientRecording(): void {\n this.recordingState = 'resumed';\n this.clients.forEach((client) => client.resumeRecording());\n }\n\n /**\n * Report an error\n * @param message\n * @param optionalParams\n */\n public error(message?: any, ...optionalParams: any[]) {\n this.clients.forEach((client) => client.error(message, ...optionalParams));\n }\n\n /**\n * Report a warning\n * @param message\n * @param optionalParams\n */\n public warn(message?: any, ...optionalParams: any[]) {\n this.clients.forEach((client) => client.warn(message, ...optionalParams));\n }\n\n /**\n * Log a message\n * @param message\n * @param optionalParams\n */\n public log(message?: any, ...optionalParams: any[]) {\n this.clients.forEach((client) => client.log(message, ...optionalParams));\n }\n\n /**\n * Log a message\n * @param message\n * @param optionalParams\n */\n public info(message?: any, ...optionalParams: any[]): void {\n this.clients.forEach((client) => (client.info ? client.info(message, ...optionalParams) : client.log(message, ...optionalParams)));\n }\n\n /**\n * Log a debug message\n * @param message\n * @param optionalParams\n */\n public debug(message?: any, ...optionalParams: any[]) {\n this.clients.forEach((client) => client.debug?.(message, ...optionalParams));\n }\n\n /**\n * Create a meta reducer to log ngrx store.\n */\n public createMetaReducer(): MetaReducer<any, Action> | MetaReducer<any, Action>[] | undefined {\n const metaReducers = this.clients\n .map((client) => client.createMetaReducer())\n .filter((metaReducer): metaReducer is MetaReducer<any, Action> => !!metaReducer);\n return metaReducers.length <= 1 ? metaReducers[0] : metaReducers;\n }\n}\n","import {\n makeEnvironmentProviders,\n} from '@angular/core';\nimport {\n LoggerClient,\n} from './logger-client';\nimport {\n ConsoleLogger,\n} from './logger-console';\nimport {\n LoggerService,\n} from './logger-service';\nimport {\n LOGGER_CLIENT_TOKEN,\n} from './logger-token';\n\n/**\n * Provide logger for the application\n * By default {@link ConsoleLogger} will be used if nothing is specified\n * @param clients Registered {@link https://github.com/AmadeusITGroup/otter/blob/main/docs/logger/LOGS.md | Logger Client}\n */\nexport function provideLogger(...clients: LoggerClient[]) {\n if (clients.length === 0) {\n clients = [new ConsoleLogger()];\n }\n return makeEnvironmentProviders([\n LoggerService,\n {\n provide: LOGGER_CLIENT_TOKEN,\n useValue: clients,\n multi: false\n }\n ]);\n}\n","/* eslint-disable no-console -- this is the purpose of this logger */\nimport type {\n Action,\n ActionReducer,\n MetaReducer,\n} from '@ngrx/store';\nimport type {\n LoggerClient,\n} from './logger-client';\n\n/**\n * Console logger used to display the logs in the browser console\n * Should be used in development mode.\n */\nexport const noopLogger: Readonly<LoggerClient> = {\n identify: () => {},\n event: () => {},\n getSessionURL: () => undefined,\n stopRecording: () => {},\n resumeRecording: () => {},\n error: console.error,\n warn: console.warn,\n debug: console.debug,\n info: console.info,\n log: console.log,\n createMetaReducer: (): MetaReducer<any, Action> => (reducer: ActionReducer<any>): ActionReducer<any> => reducer\n} as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;AAUA;;;AAGG;MACU,aAAa,CAAA;AAA1B,IAAA,WAAA,GAAA;;AAES,QAAA,IAAA,CAAA,KAAK,GAAG,OAAO,CAAC,KAAK;;AAGrB,QAAA,IAAA,CAAA,IAAI,GAAG,OAAO,CAAC,IAAI;;AAGnB,QAAA,IAAA,CAAA,KAAK,GAAG,OAAO,CAAC,KAAK;;AAGrB,QAAA,IAAA,CAAA,IAAI,GAAG,OAAO,CAAC,IAAI;;AAGnB,QAAA,IAAA,CAAA,GAAG,GAAG,OAAO,CAAC,GAAG;IAsC1B;;AAnCS,IAAA,QAAQ,CAAC,IAAY,EAAA;AAC1B,QAAA,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC;AAC9C,QAAA,IAAI,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAA,CAAE,CAAC;IACtC;;IAGO,KAAK,CAAC,IAAY,EAAE,UAAgB,EAAA;AACzC,QAAA,IAAI,CAAC,K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E,OAAO,CAAC,IAAI;IAClB,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,GAAG,EAAE,OAAO,CAAC,GAAG;IAChB,iBAAiB,EAAE,MAAgC,CAAC,OAA2B,KAAyB;;;ACzB1G;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/logger",
|
|
3
|
-
"version": "14.0.0-prerelease.
|
|
3
|
+
"version": "14.0.0-prerelease.30",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"@angular/platform-browser-dynamic": "^21.0.0",
|
|
17
17
|
"@fullstory/browser": "^2.0.0",
|
|
18
18
|
"@ngrx/store": "^21.0.0",
|
|
19
|
-
"@o3r/core": "~14.0.0-prerelease.
|
|
20
|
-
"@o3r/schematics": "~14.0.0-prerelease.
|
|
19
|
+
"@o3r/core": "~14.0.0-prerelease.30",
|
|
20
|
+
"@o3r/schematics": "~14.0.0-prerelease.30",
|
|
21
21
|
"@schematics/angular": "^21.0.0",
|
|
22
22
|
"logrocket": "^11.0.0",
|
|
23
23
|
"logrocket-ngrx": "^0.2.1",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@o3r/schematics": "~14.0.0-prerelease.
|
|
58
|
+
"@o3r/schematics": "~14.0.0-prerelease.30",
|
|
59
59
|
"tslib": "^2.6.2"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
package/types/o3r-logger.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { MetaReducer, Action } from '@ngrx/store';
|
|
|
2
2
|
import { Logger } from '@o3r/core';
|
|
3
3
|
export { Logger } from '@o3r/core';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import {
|
|
5
|
+
import { InjectionToken } from '@angular/core';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Third party client interface.
|
|
@@ -99,21 +99,6 @@ declare class ConsoleLogger implements LoggerClient {
|
|
|
99
99
|
createMetaReducer(): MetaReducer<any, Action>;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
/**
|
|
103
|
-
* @deprecated will be removed in v14.
|
|
104
|
-
*/
|
|
105
|
-
declare class LoggerModule {
|
|
106
|
-
/**
|
|
107
|
-
* Provide logger at application level
|
|
108
|
-
* By default {@link ConsoleLogger} will be used if nothing is specified
|
|
109
|
-
* @param {...LoggerClient[]} clients Registered {@link https://github.com/AmadeusITGroup/otter/blob/main/docs/logger/LOGS.md | Logger Client}
|
|
110
|
-
* @deprecated Please use {@link provideLogger} instead, will be removed in v14.
|
|
111
|
-
*/
|
|
112
|
-
static forRoot(...clients: LoggerClient[]): ModuleWithProviders<LoggerModule>;
|
|
113
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LoggerModule, never>;
|
|
114
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<LoggerModule, never, never, never>;
|
|
115
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<LoggerModule>;
|
|
116
|
-
}
|
|
117
102
|
/**
|
|
118
103
|
* Provide logger for the application
|
|
119
104
|
* By default {@link ConsoleLogger} will be used if nothing is specified
|
|
@@ -209,6 +194,6 @@ declare class LoggerService implements Logger {
|
|
|
209
194
|
|
|
210
195
|
declare const LOGGER_CLIENT_TOKEN: InjectionToken<LoggerClient | LoggerClient[]>;
|
|
211
196
|
|
|
212
|
-
export { ConsoleLogger, LOGGER_CLIENT_TOKEN,
|
|
197
|
+
export { ConsoleLogger, LOGGER_CLIENT_TOKEN, LoggerService, noopLogger, provideLogger };
|
|
213
198
|
export type { LoggerClient };
|
|
214
199
|
//# sourceMappingURL=o3r-logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-logger.d.ts","sources":["../../src/services/logger/logger-client.ts","../../src/services/logger/logger-console.ts","../../src/services/logger/logger-module.ts","../../src/services/logger/logger-noop.ts","../../src/services/logger/logger-service.ts","../../src/services/logger/logger-token.ts"],"sourcesContent":[null,null,null,null,null,null],"names":["_angular_core"],"mappings":";;;;;;AAQA;;AAEG;AACG,UAAA,YAAA,SAAA,MAAA;AACJ;;;;AAIG;AACH;AAA+B;AAAuB;AAEtD;;;;AAIG;;AAGH;;AAEG;AACH;AAEA;;AAEG;;AAGH;;AAEG;;AAGH;;;;AAIG;AACH;AAEA;;;;AAIG;AACH;AAEA;;;;AAIG;AACH;AAEA;;;;AAIG;AACH;AAEA;;;;AAIG;AACH;AAEA;;AAEG;AACH,yBAAA,WAAA,MAAA,MAAA;AACD;;ACtED;;;AAGG;AACH,cAAA,aAAA,YAAA,YAAA;;AAES;;AAGA;;AAGA;;AAGA;;AAGA;;;;;;AAkBA;;;;;;AAgBA,yBAAA,WAAA,MAAA,MAAA;AAIR;;
|
|
1
|
+
{"version":3,"file":"o3r-logger.d.ts","sources":["../../src/services/logger/logger-client.ts","../../src/services/logger/logger-console.ts","../../src/services/logger/logger-module.ts","../../src/services/logger/logger-noop.ts","../../src/services/logger/logger-service.ts","../../src/services/logger/logger-token.ts"],"sourcesContent":[null,null,null,null,null,null],"names":["_angular_core"],"mappings":";;;;;;AAQA;;AAEG;AACG,UAAA,YAAA,SAAA,MAAA;AACJ;;;;AAIG;AACH;AAA+B;AAAuB;AAEtD;;;;AAIG;;AAGH;;AAEG;AACH;AAEA;;AAEG;;AAGH;;AAEG;;AAGH;;;;AAIG;AACH;AAEA;;;;AAIG;AACH;AAEA;;;;AAIG;AACH;AAEA;;;;AAIG;AACH;AAEA;;;;AAIG;AACH;AAEA;;AAEG;AACH,yBAAA,WAAA,MAAA,MAAA;AACD;;ACtED;;;AAGG;AACH,cAAA,aAAA,YAAA,YAAA;;AAES;;AAGA;;AAGA;;AAGA;;AAGA;;;;;;AAkBA;;;;;;AAgBA,yBAAA,WAAA,MAAA,MAAA;AAIR;;AClDD;;;;AAIG;AACH,iBAAA,aAAA,aAAA,YAAA,KAAwDA,EAAA,CAAA,oBAAA;;ACXxD;;;AAGG;AACH,cAAA,UAAA,EAAA,QAAA,CAAA,YAAA;;ACOA;;AAEG;AACH,cAAA,aAAA,YAAA,MAAA;;AAKE;AAEA;;AAEG;;;AASH;;;;AAIG;AACI;AAA+B;AAAuB;AAI7D;;;;AAIG;;AAKH;;AAEG;AACI;AAOP;;;AAGG;;AAcH;;AAEG;AACI;AAKP;;AAEG;AACI;AAKP;;;;AAIG;;AAKH;;;;AAIG;;AAKH;;;;AAIG;;AAKH;;;;AAIG;AACI;AAIP;;;;AAIG;;AAKH;;AAEG;AACI,yBAAA,WAAA,MAAA,MAAA,IAAA,WAAA,MAAA,MAAA;;;AAMR;;ACtJD,cAAA,mBAAA,EAAA,cAAA,CAAA,YAAA,GAAA,YAAA;;;;"}
|