ionic-logging-service 18.0.0 → 21.0.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 +11 -21
- package/fesm2022/ionic-logging-service.mjs +42 -72
- package/fesm2022/ionic-logging-service.mjs.map +1 -1
- package/package.json +9 -8
- package/types/ionic-logging-service.d.ts +643 -0
- package/esm2022/ionic-logging-service.mjs +0 -5
- package/esm2022/lib/ajax-appender.configuration.mjs +0 -2
- package/esm2022/lib/ajax-appender.model.mjs +0 -149
- package/esm2022/lib/browser-console-appender.configuration.mjs +0 -2
- package/esm2022/lib/json-layout.model.mjs +0 -31
- package/esm2022/lib/local-storage-appender.configuration.mjs +0 -2
- package/esm2022/lib/local-storage-appender.model.mjs +0 -177
- package/esm2022/lib/log-level.converter.mjs +0 -92
- package/esm2022/lib/log-level.model.mjs +0 -47
- package/esm2022/lib/log-message.model.mjs +0 -2
- package/esm2022/lib/logger.model.mjs +0 -191
- package/esm2022/lib/logging-service.configuration.mjs +0 -2
- package/esm2022/lib/logging-service.module.mjs +0 -16
- package/esm2022/lib/logging.service.mjs +0 -167
- package/esm2022/lib/memory-appender.configuration.mjs +0 -2
- package/esm2022/lib/memory-appender.model.mjs +0 -133
- package/esm2022/public_api.mjs +0 -18
- package/index.d.ts +0 -5
- package/lib/ajax-appender.configuration.d.ts +0 -37
- package/lib/ajax-appender.model.d.ts +0 -92
- package/lib/browser-console-appender.configuration.d.ts +0 -13
- package/lib/json-layout.model.d.ts +0 -20
- package/lib/local-storage-appender.configuration.d.ts +0 -23
- package/lib/local-storage-appender.model.d.ts +0 -95
- package/lib/log-level.converter.d.ts +0 -28
- package/lib/log-level.model.d.ts +0 -37
- package/lib/log-message.model.d.ts +0 -25
- package/lib/logger.model.d.ts +0 -88
- package/lib/logging-service.configuration.d.ts +0 -40
- package/lib/logging-service.module.d.ts +0 -6
- package/lib/logging.service.d.ts +0 -84
- package/lib/memory-appender.configuration.d.ts +0 -19
- package/lib/memory-appender.model.d.ts +0 -81
- package/public_api.d.ts +0 -14
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ionic-logging-service",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Logging functionalities for apps built with Ionic framework",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Markus Wagner",
|
|
7
7
|
"email": "markus.wagner02@web.de"
|
|
8
8
|
},
|
|
9
|
-
"repository":
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/Ritzlgrmft/ionic-logging-service.git"
|
|
12
|
+
},
|
|
10
13
|
"license": "MIT",
|
|
11
14
|
"private": false,
|
|
12
15
|
"keywords": [
|
|
@@ -16,23 +19,21 @@
|
|
|
16
19
|
"log4javascript"
|
|
17
20
|
],
|
|
18
21
|
"peerDependencies": {
|
|
19
|
-
"@angular/common": ">=
|
|
20
|
-
"@angular/core": ">=
|
|
22
|
+
"@angular/common": ">=21.0.0",
|
|
23
|
+
"@angular/core": ">=21.0.0"
|
|
21
24
|
},
|
|
22
25
|
"dependencies": {
|
|
23
26
|
"log4javascript": "^1.4.16",
|
|
24
27
|
"tslib": "^2.3.1"
|
|
25
28
|
},
|
|
26
29
|
"module": "fesm2022/ionic-logging-service.mjs",
|
|
27
|
-
"typings": "
|
|
30
|
+
"typings": "types/ionic-logging-service.d.ts",
|
|
28
31
|
"exports": {
|
|
29
32
|
"./package.json": {
|
|
30
33
|
"default": "./package.json"
|
|
31
34
|
},
|
|
32
35
|
".": {
|
|
33
|
-
"types": "./
|
|
34
|
-
"esm2022": "./esm2022/ionic-logging-service.mjs",
|
|
35
|
-
"esm": "./esm2022/ionic-logging-service.mjs",
|
|
36
|
+
"types": "./types/ionic-logging-service.d.ts",
|
|
36
37
|
"default": "./fesm2022/ionic-logging-service.mjs"
|
|
37
38
|
}
|
|
38
39
|
},
|
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Signal } from '@angular/core';
|
|
3
|
+
import * as log4javascript from 'log4javascript';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for AjaxAppender.
|
|
7
|
+
*/
|
|
8
|
+
interface AjaxAppenderConfiguration {
|
|
9
|
+
/**
|
|
10
|
+
* Url to send JavaScript logs
|
|
11
|
+
*/
|
|
12
|
+
url: string;
|
|
13
|
+
/**
|
|
14
|
+
* Specifies whether cookies should be sent with each request.
|
|
15
|
+
*
|
|
16
|
+
* Default: false.
|
|
17
|
+
*/
|
|
18
|
+
withCredentials?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Number of log messages sent in each request.
|
|
21
|
+
*
|
|
22
|
+
* Default: 1.
|
|
23
|
+
*/
|
|
24
|
+
batchSize?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Interval for sending log messages (in milliseconds).
|
|
27
|
+
*
|
|
28
|
+
* If set to 0, every message will be sent immediatedly.
|
|
29
|
+
*
|
|
30
|
+
* Default: 0.
|
|
31
|
+
*/
|
|
32
|
+
timerInterval?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Threshold.
|
|
35
|
+
*
|
|
36
|
+
* Valid values are: ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN
|
|
37
|
+
*
|
|
38
|
+
* Default: WARN.
|
|
39
|
+
*/
|
|
40
|
+
threshold?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* An appender which sends the log messages to a server via HTTP.
|
|
45
|
+
*
|
|
46
|
+
* A typical configuration could be:
|
|
47
|
+
*
|
|
48
|
+
* ```json
|
|
49
|
+
* {
|
|
50
|
+
* "url": "https://my.backend.xy/LoggingBackend",
|
|
51
|
+
* "batchSize": 10,
|
|
52
|
+
* "timerInterval": 60000,
|
|
53
|
+
* "threshold": "INFO"
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
declare class AjaxAppender extends log4javascript.Appender {
|
|
58
|
+
private static batchSizeDefault;
|
|
59
|
+
private static timerIntervalDefault;
|
|
60
|
+
private static thresholdDefault;
|
|
61
|
+
private ajaxAppender;
|
|
62
|
+
private url;
|
|
63
|
+
private withCredentials;
|
|
64
|
+
private lastFailure;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a new instance of the appender.
|
|
67
|
+
*
|
|
68
|
+
* @param configuration configuration for the appender.
|
|
69
|
+
*/
|
|
70
|
+
constructor(configuration: AjaxAppenderConfiguration);
|
|
71
|
+
/**
|
|
72
|
+
* Configures the logging depending on the given configuration.
|
|
73
|
+
*
|
|
74
|
+
* Only the defined properties get overwritten.
|
|
75
|
+
* Neither url nor withCredentials can be modified.
|
|
76
|
+
*
|
|
77
|
+
* @param configuration configuration data.
|
|
78
|
+
*/
|
|
79
|
+
configure(configuration: AjaxAppenderConfiguration): void;
|
|
80
|
+
/**
|
|
81
|
+
* Appender-specific method to append a log message.
|
|
82
|
+
*
|
|
83
|
+
* @param loggingEvent event to be appended.
|
|
84
|
+
*/
|
|
85
|
+
append(loggingEvent: log4javascript.LoggingEvent): void;
|
|
86
|
+
/**
|
|
87
|
+
* Gets the appender's name.
|
|
88
|
+
* Mainly for unit testing purposes.
|
|
89
|
+
*
|
|
90
|
+
* @return appender's name
|
|
91
|
+
*/
|
|
92
|
+
toString(): string;
|
|
93
|
+
/**
|
|
94
|
+
* Get the internally used appender.
|
|
95
|
+
* Mainly for unit testing purposes.
|
|
96
|
+
*/
|
|
97
|
+
getInternalAppender(): log4javascript.AjaxAppender;
|
|
98
|
+
/**
|
|
99
|
+
* Returns the number of log messages sent in each request.
|
|
100
|
+
*/
|
|
101
|
+
getBatchSize(): number;
|
|
102
|
+
/**
|
|
103
|
+
* Sets the number of log messages to send in each request.
|
|
104
|
+
*
|
|
105
|
+
* @param batchSize new batch size
|
|
106
|
+
*/
|
|
107
|
+
setBatchSize(batchSize: number): void;
|
|
108
|
+
/**
|
|
109
|
+
* Returns the appender's layout.
|
|
110
|
+
*/
|
|
111
|
+
getLayout(): log4javascript.Layout;
|
|
112
|
+
/**
|
|
113
|
+
* Sets the appender's layout.
|
|
114
|
+
*/
|
|
115
|
+
setLayout(layout: log4javascript.Layout): void;
|
|
116
|
+
/**
|
|
117
|
+
* Returns the length of time in milliseconds between each sending of queued log messages.
|
|
118
|
+
*/
|
|
119
|
+
getTimerInterval(): number;
|
|
120
|
+
/**
|
|
121
|
+
* Sets the length of time in milliseconds between each sending of queued log messages.
|
|
122
|
+
*
|
|
123
|
+
* @param timerInterval new timer interval
|
|
124
|
+
*/
|
|
125
|
+
setTimerInterval(timerInterval: number): void;
|
|
126
|
+
/**
|
|
127
|
+
* Last error message when the appender could not send log messages to the server.
|
|
128
|
+
* @returns error message
|
|
129
|
+
*/
|
|
130
|
+
getLastFailure(): Signal<string>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Configuration for BrowserConsoleAppender.
|
|
135
|
+
*/
|
|
136
|
+
interface BrowserConsoleAppenderConfiguration {
|
|
137
|
+
/**
|
|
138
|
+
* Threshold.
|
|
139
|
+
*
|
|
140
|
+
* Valid values are: ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN
|
|
141
|
+
*
|
|
142
|
+
* Default: DEBUG.
|
|
143
|
+
*/
|
|
144
|
+
threshold?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Configuration for LocalStorageAppender.
|
|
149
|
+
*/
|
|
150
|
+
interface LocalStorageAppenderConfiguration {
|
|
151
|
+
/**
|
|
152
|
+
* Key which is used to store the messages in the local storage.
|
|
153
|
+
*/
|
|
154
|
+
localStorageKey: string;
|
|
155
|
+
/**
|
|
156
|
+
* Maximum number of log messages stored by the appender.
|
|
157
|
+
*
|
|
158
|
+
* Default: 250.
|
|
159
|
+
*/
|
|
160
|
+
maxMessages?: number;
|
|
161
|
+
/**
|
|
162
|
+
* Threshold.
|
|
163
|
+
*
|
|
164
|
+
* Valid values are: ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN
|
|
165
|
+
*
|
|
166
|
+
* Default: WARN.
|
|
167
|
+
*/
|
|
168
|
+
threshold?: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Log message.
|
|
173
|
+
*/
|
|
174
|
+
interface LogMessage {
|
|
175
|
+
/**
|
|
176
|
+
* Time when the log was written.
|
|
177
|
+
*/
|
|
178
|
+
timeStamp: Date;
|
|
179
|
+
/**
|
|
180
|
+
* Log level.
|
|
181
|
+
*/
|
|
182
|
+
level: string;
|
|
183
|
+
/**
|
|
184
|
+
* Name of the logger.
|
|
185
|
+
*/
|
|
186
|
+
logger: string;
|
|
187
|
+
/**
|
|
188
|
+
* Method, in which the message was written.
|
|
189
|
+
*/
|
|
190
|
+
methodName: string;
|
|
191
|
+
/**
|
|
192
|
+
* Message.
|
|
193
|
+
*/
|
|
194
|
+
message: string[];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* An appender which stores the log messages in the browser's local storage.
|
|
199
|
+
*
|
|
200
|
+
* The messages are saved JSON-serialized.
|
|
201
|
+
* You have to configure which key is used for storing the messages.
|
|
202
|
+
*
|
|
203
|
+
* A typical configuration could be:
|
|
204
|
+
*
|
|
205
|
+
* ```json
|
|
206
|
+
* {
|
|
207
|
+
* "localStorageKey": "myLogs",
|
|
208
|
+
* "maxMessages": 500,
|
|
209
|
+
* "threshold": "INFO"
|
|
210
|
+
* }
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
declare class LocalStorageAppender extends log4javascript.Appender {
|
|
214
|
+
private static maxMessagesDefault;
|
|
215
|
+
private static thresholdDefault;
|
|
216
|
+
private maxMessages;
|
|
217
|
+
private localStorageKey;
|
|
218
|
+
private logMessages;
|
|
219
|
+
/**
|
|
220
|
+
* Creates a new instance of the appender.
|
|
221
|
+
*
|
|
222
|
+
* @param configuration configuration for the appender.
|
|
223
|
+
*/
|
|
224
|
+
constructor(configuration: LocalStorageAppenderConfiguration);
|
|
225
|
+
/**
|
|
226
|
+
* Load log messages from local storage which are stored there under the given key.
|
|
227
|
+
*
|
|
228
|
+
* @param localStorageKey local storage key
|
|
229
|
+
* @return stored messages
|
|
230
|
+
*/
|
|
231
|
+
static loadLogMessages(localStorageKey: string): LogMessage[];
|
|
232
|
+
/**
|
|
233
|
+
* Remove log messages from local storage which are stored there under the given key.
|
|
234
|
+
*
|
|
235
|
+
* @param localStorageKey local storage key
|
|
236
|
+
*/
|
|
237
|
+
static removeLogMessages(localStorageKey: string): void;
|
|
238
|
+
/**
|
|
239
|
+
* Configures the logging depending on the given configuration.
|
|
240
|
+
*
|
|
241
|
+
* Only the defined properties get overwritten.
|
|
242
|
+
* The localStorageKey cannot be modified.
|
|
243
|
+
*
|
|
244
|
+
* @param configuration configuration data.
|
|
245
|
+
*/
|
|
246
|
+
configure(configuration: LocalStorageAppenderConfiguration): void;
|
|
247
|
+
/**
|
|
248
|
+
* Appender-specific method to append a log message.
|
|
249
|
+
*
|
|
250
|
+
* @param loggingEvent event to be appended.
|
|
251
|
+
*/
|
|
252
|
+
append(loggingEvent: log4javascript.LoggingEvent): void;
|
|
253
|
+
/**
|
|
254
|
+
* Gets the appender's name.
|
|
255
|
+
* Mainly for unit testing purposes.
|
|
256
|
+
*
|
|
257
|
+
* @return appender's name
|
|
258
|
+
*/
|
|
259
|
+
toString(): string;
|
|
260
|
+
/**
|
|
261
|
+
* Get the key which is used to store the messages in the local storage.
|
|
262
|
+
*/
|
|
263
|
+
getLocalStorageKey(): string;
|
|
264
|
+
/**
|
|
265
|
+
* Get the maximum number of messages which will be stored in local storage.
|
|
266
|
+
*/
|
|
267
|
+
getMaxMessages(): number;
|
|
268
|
+
/**
|
|
269
|
+
* Set the maximum number of messages which will be stored in local storage.
|
|
270
|
+
*
|
|
271
|
+
* If the appender stores currently more messages than the new value allows, the oldest messages get removed.
|
|
272
|
+
*
|
|
273
|
+
* @param value new maximum number
|
|
274
|
+
*/
|
|
275
|
+
setMaxMessages(value: number): void;
|
|
276
|
+
/**
|
|
277
|
+
* Gets all messages stored in local storage.
|
|
278
|
+
* Mainly for unit testing purposes.
|
|
279
|
+
*
|
|
280
|
+
* @return stored messages
|
|
281
|
+
*/
|
|
282
|
+
getLogMessages(): LogMessage[];
|
|
283
|
+
/**
|
|
284
|
+
* Removes all messages from local storage.
|
|
285
|
+
* Mainly for unit testing purposes.
|
|
286
|
+
*/
|
|
287
|
+
clearLog(): void;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Logging levels.
|
|
292
|
+
*/
|
|
293
|
+
declare enum LogLevel {
|
|
294
|
+
/**
|
|
295
|
+
* All events should be logged.
|
|
296
|
+
*/
|
|
297
|
+
ALL = 0,
|
|
298
|
+
/**
|
|
299
|
+
* A fine-grained debug message, typically capturing the flow through the application.
|
|
300
|
+
*/
|
|
301
|
+
TRACE = 1,
|
|
302
|
+
/**
|
|
303
|
+
* A general debugging event.
|
|
304
|
+
*/
|
|
305
|
+
DEBUG = 2,
|
|
306
|
+
/**
|
|
307
|
+
* An event for informational purposes.
|
|
308
|
+
*/
|
|
309
|
+
INFO = 3,
|
|
310
|
+
/**
|
|
311
|
+
* An event that might possible lead to an error.
|
|
312
|
+
*/
|
|
313
|
+
WARN = 4,
|
|
314
|
+
/**
|
|
315
|
+
* An error in the application, possibly recoverable.
|
|
316
|
+
*/
|
|
317
|
+
ERROR = 5,
|
|
318
|
+
/**
|
|
319
|
+
* A severe error that will prevent the application from continuing.
|
|
320
|
+
*/
|
|
321
|
+
FATAL = 6,
|
|
322
|
+
/**
|
|
323
|
+
* No events will be logged.
|
|
324
|
+
*/
|
|
325
|
+
OFF = 7
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Helper class for converting log levels from and to different data type.
|
|
330
|
+
*/
|
|
331
|
+
declare class LogLevelConverter {
|
|
332
|
+
/**
|
|
333
|
+
* Converts log4javascript.Level to internal LogLevel.
|
|
334
|
+
*
|
|
335
|
+
* @param level log4javascript's data type
|
|
336
|
+
* @return internal data type.
|
|
337
|
+
*/
|
|
338
|
+
static levelFromLog4Javascript(level: log4javascript.Level): LogLevel;
|
|
339
|
+
/**
|
|
340
|
+
* Converts string representation to internal LogLevel.
|
|
341
|
+
*
|
|
342
|
+
* @param level string representation
|
|
343
|
+
* @return internal data type.
|
|
344
|
+
*/
|
|
345
|
+
static levelFromString(level: string): LogLevel;
|
|
346
|
+
/**
|
|
347
|
+
* Converts internal LogLevel to log4javascript.Level.
|
|
348
|
+
*
|
|
349
|
+
* @param internal data type.
|
|
350
|
+
* @return level log4javascript's data type
|
|
351
|
+
*/
|
|
352
|
+
static levelToLog4Javascript(level: LogLevel): log4javascript.Level;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Logger for writing log messages.
|
|
357
|
+
*/
|
|
358
|
+
declare class Logger {
|
|
359
|
+
private logger;
|
|
360
|
+
/**
|
|
361
|
+
* Creates a new instance of a logger.
|
|
362
|
+
*/
|
|
363
|
+
constructor(logger?: string | any);
|
|
364
|
+
/**
|
|
365
|
+
* Get the log level.
|
|
366
|
+
*/
|
|
367
|
+
getLogLevel(): LogLevel;
|
|
368
|
+
/**
|
|
369
|
+
* Set the log level.
|
|
370
|
+
*
|
|
371
|
+
* @param level the new log level
|
|
372
|
+
*/
|
|
373
|
+
setLogLevel(level: LogLevel): void;
|
|
374
|
+
/**
|
|
375
|
+
* Logs a message at level TRACE.
|
|
376
|
+
*
|
|
377
|
+
* @param methodName name of the method
|
|
378
|
+
* @param params optional parameters to be logged; objects will be formatted as JSON
|
|
379
|
+
*/
|
|
380
|
+
trace(methodName: string, ...params: any[]): void;
|
|
381
|
+
/**
|
|
382
|
+
* Logs a message at level DEBUG.
|
|
383
|
+
*
|
|
384
|
+
* @param methodName name of the method
|
|
385
|
+
* @param params optional parameters to be logged; objects will be formatted as JSON
|
|
386
|
+
*/
|
|
387
|
+
debug(methodName: string, ...params: any[]): void;
|
|
388
|
+
/**
|
|
389
|
+
* Logs a message at level INFO.
|
|
390
|
+
*
|
|
391
|
+
* @param methodName name of the method
|
|
392
|
+
* @param params optional parameters to be logged; objects will be formatted as JSON
|
|
393
|
+
*/
|
|
394
|
+
info(methodName: string, ...params: any[]): void;
|
|
395
|
+
/**
|
|
396
|
+
* Logs a message at level WARN.
|
|
397
|
+
*
|
|
398
|
+
* @param methodName name of the method
|
|
399
|
+
* @param params optional parameters to be logged; objects will be formatted as JSON
|
|
400
|
+
*/
|
|
401
|
+
warn(methodName: string, ...params: any[]): void;
|
|
402
|
+
/**
|
|
403
|
+
* Logs a message at level ERROR.
|
|
404
|
+
*
|
|
405
|
+
* @param methodName name of the method
|
|
406
|
+
* @param params optional parameters to be logged; objects will be formatted as JSON
|
|
407
|
+
*/
|
|
408
|
+
error(methodName: string, ...params: any[]): void;
|
|
409
|
+
/**
|
|
410
|
+
* Logs a message at level FATAL.
|
|
411
|
+
*
|
|
412
|
+
* @param methodName name of the method
|
|
413
|
+
* @param params optional parameters to be logged; objects will be formatted as JSON
|
|
414
|
+
*/
|
|
415
|
+
fatal(methodName: string, ...params: any[]): void;
|
|
416
|
+
/**
|
|
417
|
+
* Logs the entry into a method.
|
|
418
|
+
* The method name will be logged at level INFO, the parameters at level DEBUG.
|
|
419
|
+
*
|
|
420
|
+
* @param methodName name of the method
|
|
421
|
+
* @param params optional parameters to be logged; objects will be formatted as JSON
|
|
422
|
+
*/
|
|
423
|
+
entry(methodName: string, ...params: any[]): void;
|
|
424
|
+
/**
|
|
425
|
+
* Logs the exit of a method.
|
|
426
|
+
* The method name will be logged at level INFO, the parameters at level DEBUG.
|
|
427
|
+
*
|
|
428
|
+
* @param methodName name of the method
|
|
429
|
+
* @param params optional parameters to be logged; objects will be formatted as JSON
|
|
430
|
+
*/
|
|
431
|
+
exit(methodName: string, ...params: any[]): void;
|
|
432
|
+
/**
|
|
433
|
+
* Formats the given argument.
|
|
434
|
+
*/
|
|
435
|
+
formatArgument(arg: any): string;
|
|
436
|
+
/**
|
|
437
|
+
* Returns the internal Logger (for unit tests only).
|
|
438
|
+
*/
|
|
439
|
+
getInternalLogger(): log4javascript.Logger;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Configuration for MemoryAppender.
|
|
444
|
+
*/
|
|
445
|
+
interface MemoryAppenderConfiguration {
|
|
446
|
+
/**
|
|
447
|
+
* Maximum number of log messages stored by the appender.
|
|
448
|
+
*
|
|
449
|
+
* Default: 250.
|
|
450
|
+
*/
|
|
451
|
+
maxMessages?: number;
|
|
452
|
+
/**
|
|
453
|
+
* Threshold.
|
|
454
|
+
*
|
|
455
|
+
* Valid values are: ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN.
|
|
456
|
+
*
|
|
457
|
+
* Default: ALL.
|
|
458
|
+
*/
|
|
459
|
+
threshold?: string;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Partial configuration definition for LoggingService.
|
|
464
|
+
*/
|
|
465
|
+
interface LoggingServiceConfiguration {
|
|
466
|
+
/**
|
|
467
|
+
* Log levels for different loggers.
|
|
468
|
+
* Default: root: WARN
|
|
469
|
+
*/
|
|
470
|
+
logLevels?: {
|
|
471
|
+
/**
|
|
472
|
+
* Logger name or "root" for root logger.
|
|
473
|
+
*/
|
|
474
|
+
loggerName: string;
|
|
475
|
+
/**
|
|
476
|
+
* Log level.
|
|
477
|
+
* Valid values are: ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN
|
|
478
|
+
*/
|
|
479
|
+
logLevel: string;
|
|
480
|
+
}[];
|
|
481
|
+
/**
|
|
482
|
+
* Settings for AjaxAppender.
|
|
483
|
+
*/
|
|
484
|
+
ajaxAppender?: AjaxAppenderConfiguration;
|
|
485
|
+
/**
|
|
486
|
+
* Settings for LocalStorageAppender.
|
|
487
|
+
*/
|
|
488
|
+
localStorageAppender?: LocalStorageAppenderConfiguration;
|
|
489
|
+
/**
|
|
490
|
+
* Settings for MemoryAppender.
|
|
491
|
+
*/
|
|
492
|
+
memoryAppender?: MemoryAppenderConfiguration;
|
|
493
|
+
/**
|
|
494
|
+
* Settings for BrowserConsoleAppender.
|
|
495
|
+
*/
|
|
496
|
+
browserConsoleAppender?: BrowserConsoleAppenderConfiguration;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Service for logging functionality.
|
|
501
|
+
*
|
|
502
|
+
* By default, the following settings are used:
|
|
503
|
+
* - logger: root with level WARN
|
|
504
|
+
* - appender: BrowserConsoleAppender with threshold DEBUG and MemoryAppender with threshold ALL
|
|
505
|
+
*
|
|
506
|
+
* Via [configure](#configure), it is possible to amend these settings.
|
|
507
|
+
*/
|
|
508
|
+
declare class LoggingService {
|
|
509
|
+
private memoryAppender;
|
|
510
|
+
private browserConsoleAppender;
|
|
511
|
+
private ajaxAppender;
|
|
512
|
+
/**
|
|
513
|
+
* Creates a new instance of the service.
|
|
514
|
+
*/
|
|
515
|
+
constructor();
|
|
516
|
+
/**
|
|
517
|
+
* Configures the logging depending on the given configuration.
|
|
518
|
+
*
|
|
519
|
+
* @param configuration configuration data.
|
|
520
|
+
*/
|
|
521
|
+
configure(configuration?: LoggingServiceConfiguration): void;
|
|
522
|
+
/**
|
|
523
|
+
* Gets the root logger from which all other loggers derive.
|
|
524
|
+
*
|
|
525
|
+
* @return root logger
|
|
526
|
+
*/
|
|
527
|
+
getRootLogger(): Logger;
|
|
528
|
+
/**
|
|
529
|
+
* Gets a logger with the specified name, creating it if a logger with that name does not already exist.
|
|
530
|
+
*
|
|
531
|
+
* @param loggerName name of the logger
|
|
532
|
+
* @return logger
|
|
533
|
+
*/
|
|
534
|
+
getLogger(loggerName: string): Logger;
|
|
535
|
+
/**
|
|
536
|
+
* Gets the last log messages.
|
|
537
|
+
*
|
|
538
|
+
* The log messages are retrieved from the internal [MemoryAppender](../memoryappender.html).
|
|
539
|
+
* That means you will get only the most current messages. The number of the messages is limited
|
|
540
|
+
* by its maxMessages value.
|
|
541
|
+
*
|
|
542
|
+
* @return log messages
|
|
543
|
+
*/
|
|
544
|
+
getLogMessages(): Signal<LogMessage[]>;
|
|
545
|
+
/**
|
|
546
|
+
* Loads the log messages written by the LocalStorageAppender with the given key.
|
|
547
|
+
*
|
|
548
|
+
* @param localStorageKey key for the local storage
|
|
549
|
+
* @returns log messages
|
|
550
|
+
*/
|
|
551
|
+
getLogMessagesFromLocalStorage(localStorageKey: string): LogMessage[];
|
|
552
|
+
/**
|
|
553
|
+
* Remove all log messages.
|
|
554
|
+
*/
|
|
555
|
+
removeLogMessages(): void;
|
|
556
|
+
/**
|
|
557
|
+
* Removes the log messages written by the LocalStorageAppender with the given key.
|
|
558
|
+
*
|
|
559
|
+
* @param localStorageKey key for the local storage
|
|
560
|
+
*/
|
|
561
|
+
removeLogMessagesFromLocalStorage(localStorageKey: string): void;
|
|
562
|
+
/**
|
|
563
|
+
* Error messages when the ajax appender could not send log messages to the server.
|
|
564
|
+
* @returns error messages
|
|
565
|
+
*/
|
|
566
|
+
getLastAjaxAppenderFailure(): Signal<string>;
|
|
567
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LoggingService, never>;
|
|
568
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LoggingService>;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* An appender which stores the log messages in the browser's memory.
|
|
573
|
+
*
|
|
574
|
+
* The MemoryAppender is enabled by default.
|
|
575
|
+
* If you do not specify anything else, it is using this configuration:
|
|
576
|
+
*
|
|
577
|
+
* ```JSON
|
|
578
|
+
* {
|
|
579
|
+
* "memoryAppender": [
|
|
580
|
+
* {
|
|
581
|
+
* "maxMessages": 250,
|
|
582
|
+
* "threshold": "ALL"
|
|
583
|
+
* }
|
|
584
|
+
* }
|
|
585
|
+
* ```
|
|
586
|
+
*/
|
|
587
|
+
declare class MemoryAppender extends log4javascript.Appender {
|
|
588
|
+
private static maxMessagesDefault;
|
|
589
|
+
private static thresholdDefault;
|
|
590
|
+
private maxMessages;
|
|
591
|
+
private logMessages;
|
|
592
|
+
/**
|
|
593
|
+
* Creates a new instance of the appender.
|
|
594
|
+
*
|
|
595
|
+
* @param configuration configuration for the appender.
|
|
596
|
+
*/
|
|
597
|
+
constructor(configuration?: MemoryAppenderConfiguration);
|
|
598
|
+
/**
|
|
599
|
+
* Configures the logging depending on the given configuration.
|
|
600
|
+
* Only the defined properties get overwritten.
|
|
601
|
+
*
|
|
602
|
+
* @param configuration configuration data.
|
|
603
|
+
*/
|
|
604
|
+
configure(configuration: MemoryAppenderConfiguration): void;
|
|
605
|
+
/**
|
|
606
|
+
* Appender-specific method to append a log message.
|
|
607
|
+
*
|
|
608
|
+
* @param loggingEvent event to be appended.
|
|
609
|
+
*/
|
|
610
|
+
append(loggingEvent: log4javascript.LoggingEvent): void;
|
|
611
|
+
/**
|
|
612
|
+
* Gets the appender's name.
|
|
613
|
+
* Mainly for unit testing purposes.
|
|
614
|
+
*
|
|
615
|
+
* @return appender's name
|
|
616
|
+
*/
|
|
617
|
+
toString(): string;
|
|
618
|
+
/**
|
|
619
|
+
* Get the maximum number of messages which will be stored in memory.
|
|
620
|
+
*/
|
|
621
|
+
getMaxMessages(): number;
|
|
622
|
+
/**
|
|
623
|
+
* Set the maximum number of messages which will be stored in memory.
|
|
624
|
+
*
|
|
625
|
+
* If the appender stores currently more messages than the new value allows, the oldest messages get removed.
|
|
626
|
+
*
|
|
627
|
+
* @param value new maximum number
|
|
628
|
+
*/
|
|
629
|
+
setMaxMessages(value: number): void;
|
|
630
|
+
/**
|
|
631
|
+
* Gets all messages stored in memory.
|
|
632
|
+
*
|
|
633
|
+
* @return stored messages
|
|
634
|
+
*/
|
|
635
|
+
getLogMessages(): Signal<LogMessage[]>;
|
|
636
|
+
/**
|
|
637
|
+
* Remove all messages stored in memory.
|
|
638
|
+
*/
|
|
639
|
+
removeLogMessages(): void;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export { AjaxAppender, LocalStorageAppender, LogLevel, LogLevelConverter, Logger, LoggingService, MemoryAppender };
|
|
643
|
+
export type { AjaxAppenderConfiguration, BrowserConsoleAppenderConfiguration, LocalStorageAppenderConfiguration, LogMessage, LoggingServiceConfiguration, MemoryAppenderConfiguration };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public_api';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW9uaWMtbG9nZ2luZy1zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvaW9uaWMtbG9nZ2luZy1zZXJ2aWNlL3NyYy9pb25pYy1sb2dnaW5nLXNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWNfYXBpJztcbiJdfQ==
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWpheC1hcHBlbmRlci5jb25maWd1cmF0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvaW9uaWMtbG9nZ2luZy1zZXJ2aWNlL3NyYy9saWIvYWpheC1hcHBlbmRlci5jb25maWd1cmF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvbmZpZ3VyYXRpb24gZm9yIEFqYXhBcHBlbmRlci5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBBamF4QXBwZW5kZXJDb25maWd1cmF0aW9uIHtcblxuXHQvKipcblx0ICogVXJsIHRvIHNlbmQgSmF2YVNjcmlwdCBsb2dzXG5cdCAqL1xuXHR1cmw6IHN0cmluZztcblxuXHQvKipcblx0ICogU3BlY2lmaWVzIHdoZXRoZXIgY29va2llcyBzaG91bGQgYmUgc2VudCB3aXRoIGVhY2ggcmVxdWVzdC5cblx0ICpcblx0ICogRGVmYXVsdDogZmFsc2UuXG5cdCAqL1xuXHR3aXRoQ3JlZGVudGlhbHM/OiBib29sZWFuO1xuXG5cdC8qKlxuXHQgKiBOdW1iZXIgb2YgbG9nIG1lc3NhZ2VzIHNlbnQgaW4gZWFjaCByZXF1ZXN0LlxuXHQgKlxuXHQgKiBEZWZhdWx0OiAxLlxuXHQgKi9cblx0YmF0Y2hTaXplPzogbnVtYmVyO1xuXG5cdC8qKlxuXHQgKiBJbnRlcnZhbCBmb3Igc2VuZGluZyBsb2cgbWVzc2FnZXMgKGluIG1pbGxpc2Vjb25kcykuXG5cdCAqXG5cdCAqIElmIHNldCB0byAwLCBldmVyeSBtZXNzYWdlIHdpbGwgYmUgc2VudCBpbW1lZGlhdGVkbHkuXG5cdCAqXG5cdCAqIERlZmF1bHQ6IDAuXG5cdCAqL1xuXHR0aW1lckludGVydmFsPzogbnVtYmVyO1xuXG5cdC8qKlxuXHQgKiBUaHJlc2hvbGQuXG5cdCAqXG5cdCAqIFZhbGlkIHZhbHVlcyBhcmU6IEFMTCwgREVCVUcsIEVSUk9SLCBGQVRBTCwgSU5GTywgT0ZGLCBUUkFDRSwgV0FSTlxuXHQgKlxuXHQgKiBEZWZhdWx0OiBXQVJOLlxuXHQgKi9cblx0dGhyZXNob2xkPzogc3RyaW5nO1xufVxuIl19
|