Skip to content

feat: allow to change default way to parse callstack#914

Merged
nomiddlename merged 2 commits intolog4js-node:masterfrom
rommni:feature/setParseCallStack
Jul 9, 2019
Merged

feat: allow to change default way to parse callstack#914
nomiddlename merged 2 commits intolog4js-node:masterfrom
rommni:feature/setParseCallStack

Conversation

@rommni
Copy link
Copy Markdown

@rommni rommni commented Jul 9, 2019

Add a function to the logger to edit the function parsing the callstack.

Use case example: Can be use when all the call to logger.log are made from a custom "debug" class (called from outside with debug.log, debug.warn, etc ... ), doing the interface between debuging an app and log4js, to allow more flexibility, and you want to use layout patern to show the fileName where the debug.x is called.

You can this way create a custom function parsing callStack and removing lines concerning your "debug" class, and then give it to the logger.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 9, 2019

Codecov Report

Merging #914 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #914      +/-   ##
==========================================
+ Coverage   97.98%   97.99%   +<.01%     
==========================================
  Files          25       25              
  Lines         995      997       +2     
==========================================
+ Hits          975      977       +2     
  Misses         20       20
Impacted Files Coverage Δ
lib/logger.js 97.77% <100%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d7fd0c...015d060. Read the comment docs.

Copy link
Copy Markdown
Collaborator

@nomiddlename nomiddlename left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, especially for taking the time to write the documentation - makes my job a bit easier.

@nomiddlename nomiddlename added this to the 4.4.1 milestone Jul 9, 2019
@nomiddlename nomiddlename merged commit 1cc724d into log4js-node:master Jul 9, 2019
@nomiddlename
Copy link
Copy Markdown
Collaborator

Published to npm in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants