Skip to content

Commit

Permalink
fix(): add missing description comment for enrichNext()
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelvesavuori committed Feb 14, 2023
1 parent 3018b49 commit f8c0e5f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mikrolog",
"description": "The JSON logger you always wanted for Lambda.",
"version": "2.1.13",
"version": "2.1.14",
"author": "Mikael Vesavuori",
"license": "MIT",
"main": "./lib/index.js",
Expand Down
14 changes: 13 additions & 1 deletion src/entities/MikroLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,19 @@ export class MikroLog {
}

/**
* @description TODO
* @description If you want a one-time root-level enrichment, you can do:
*
* ```
* const logger = MikroLog.start();
* logger.enrichNext({ someId: '123456789abcdefghi' });
* logger.info('Ping!'); // Enrichment is present on log
* logger.info('Ping!'); // Enrichment is longer present
* ```
*
* You can also use nested objects:
* ```
* logger.enrichNext({ myObject: { myValue: 'Something here', otherValue: 'Something else' } });
* ```
*/
public enrichNext(input: Record<string, any>) {
this.nextLogEnrichment = input;
Expand Down

0 comments on commit f8c0e5f

Please sign in to comment.