Skip to content

Commit c4050b2

Browse files
author
Julia Eskew
authored
Merge pull request #178 from edx/juliasq/correct_logging_interface_docs
docs: Add recent changes to the logging interface documentation.
2 parents 821c87e + fbb777f commit c4050b2

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

src/logging/interface.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* });
1717
*
1818
* logInfo('Just so you know...');
19+
* logInfo(new Error('Unimportant error'), { type: 'unimportant' });
1920
* logError('Uhoh!');
2021
* logError(new Error('Uhoh error!'));
2122
* ```
@@ -49,25 +50,25 @@ export function configure(LoggingService, options) {
4950
}
5051

5152
/**
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.
5355
*
54-
* @param {string} message
56+
* @param {string|Error} infoStringOrErrorObject
5557
* @param {Object} [customAttributes={}]
5658
*/
57-
export function logInfo(message, customAttributes) {
58-
return service.logInfo(message, customAttributes);
59+
export function logInfo(infoStringOrErrorObject, customAttributes) {
60+
return service.logInfo(infoStringOrErrorObject, customAttributes);
5961
}
6062

6163
/**
6264
* Logs a message to the 'error' log level. Can accept custom attributes as a property of the error
6365
* object, or as an optional second parameter.
6466
*
65-
* @param {string|Error} error
66-
* @param {Object} [error.customAttributes={}]
67+
* @param {string|Error} errorStringOrObject
6768
* @param {Object} [customAttributes={}]
6869
*/
69-
export function logError(error, customAttributes) {
70-
return service.logError(error, customAttributes);
70+
export function logError(errorStringOrObject, customAttributes) {
71+
return service.logError(errorStringOrObject, customAttributes);
7172
}
7273

7374
/**

0 commit comments

Comments
 (0)