|
16 | 16 | * }); |
17 | 17 | * |
18 | 18 | * logInfo('Just so you know...'); |
| 19 | + * logInfo(new Error('Unimportant error'), { type: 'unimportant' }); |
19 | 20 | * logError('Uhoh!'); |
20 | 21 | * logError(new Error('Uhoh error!')); |
21 | 22 | * ``` |
@@ -49,25 +50,25 @@ export function configure(LoggingService, options) { |
49 | 50 | } |
50 | 51 |
|
51 | 52 | /** |
52 | | - * Logs a message to the 'info' log level. |
| 53 | + * Logs a message to the 'info' log level. Can accept custom attributes as a property of the error |
| 54 | + * object, or as an optional second parameter. |
53 | 55 | * |
54 | | - * @param {string} message |
| 56 | + * @param {string|Error} infoStringOrErrorObject |
55 | 57 | * @param {Object} [customAttributes={}] |
56 | 58 | */ |
57 | | -export function logInfo(message, customAttributes) { |
58 | | - return service.logInfo(message, customAttributes); |
| 59 | +export function logInfo(infoStringOrErrorObject, customAttributes) { |
| 60 | + return service.logInfo(infoStringOrErrorObject, customAttributes); |
59 | 61 | } |
60 | 62 |
|
61 | 63 | /** |
62 | 64 | * Logs a message to the 'error' log level. Can accept custom attributes as a property of the error |
63 | 65 | * object, or as an optional second parameter. |
64 | 66 | * |
65 | | - * @param {string|Error} error |
66 | | - * @param {Object} [error.customAttributes={}] |
| 67 | + * @param {string|Error} errorStringOrObject |
67 | 68 | * @param {Object} [customAttributes={}] |
68 | 69 | */ |
69 | | -export function logError(error, customAttributes) { |
70 | | - return service.logError(error, customAttributes); |
| 70 | +export function logError(errorStringOrObject, customAttributes) { |
| 71 | + return service.logError(errorStringOrObject, customAttributes); |
71 | 72 | } |
72 | 73 |
|
73 | 74 | /** |
|
0 commit comments