New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we add a "trace" level? #33

Closed
diegograsso opened this Issue Dec 1, 2016 · 6 comments

Comments

Projects
None yet
4 participants
@diegograsso

diegograsso commented Dec 1, 2016

I'm submitting a feature request

  • Library Version:
    1.1.1

Please tell us about your environment:

  • Operating System:
    OSX 10.x

  • Node Version:
    5.10.0

  • NPM Version:
    3.8.3

  • JSPM OR Webpack AND Version
    JSPM 0.16.32

  • Browser:
    all

  • Language:
    all

Current behavior:
4 log levels supported

Expected/desired behavior:
Add a 5th level: trace

  • What is the expected behavior?

  • What is the motivation / use case for changing the behavior?
    I would like adda an appender that has this level of logging.

@EisenbergEffect

This comment has been minimized.

Show comment
Hide comment
@EisenbergEffect

EisenbergEffect Dec 3, 2016

Member

Can you clarify why you need another level and what you would call it?

Member

EisenbergEffect commented Dec 3, 2016

Can you clarify why you need another level and what you would call it?

@diegograsso

This comment has been minimized.

Show comment
Hide comment
@diegograsso

diegograsso Dec 6, 2016

Yes, I would call it "trace", like the method available on the console:
https://developer.mozilla.org/en-US/docs/Web/API/Console/trace
I know it's not standard but it's supported by all major browsers and node. It prints the message and adds the stack trace of the call, sometimes it's useful for debugging. We had it in our custom log library that I'm replacing by Aurelia's.

diegograsso commented Dec 6, 2016

Yes, I would call it "trace", like the method available on the console:
https://developer.mozilla.org/en-US/docs/Web/API/Console/trace
I know it's not standard but it's supported by all major browsers and node. It prints the message and adds the stack trace of the call, sometimes it's useful for debugging. We had it in our custom log library that I'm replacing by Aurelia's.

@EisenbergEffect

This comment has been minimized.

Show comment
Hide comment
@EisenbergEffect

EisenbergEffect Feb 21, 2017

Member

If you would be willing to submit a PR, we could put this in.

Member

EisenbergEffect commented Feb 21, 2017

If you would be willing to submit a PR, we could put this in.

@krisdages

This comment has been minimized.

Show comment
Hide comment
@krisdages

krisdages Sep 10, 2017

Contributor

I have a similar requirement and I have made some customizations to be able to add arbitrary additional log levels with methods

addCustomLevel(name, value) 
removeCustomLevel(name)

Resetting the configuration for testing was sort of difficult since LogManager is a singleton and there isn't currently a way to get the appenders list, so I added

getAppenders() {  return [...appenders]; }
clearAppenders() { ... }

It sounds like you are possibly redoing this library in TypeScript, but I could still submit a PR if you want.

Contributor

krisdages commented Sep 10, 2017

I have a similar requirement and I have made some customizations to be able to add arbitrary additional log levels with methods

addCustomLevel(name, value) 
removeCustomLevel(name)

Resetting the configuration for testing was sort of difficult since LogManager is a singleton and there isn't currently a way to get the appenders list, so I added

getAppenders() {  return [...appenders]; }
clearAppenders() { ... }

It sounds like you are possibly redoing this library in TypeScript, but I could still submit a PR if you want.

krisdages added a commit to krisdages/aurelia-logging that referenced this issue Sep 11, 2017

feat(log-manager): add custom log levels
Adds methods addCustomLevel(name, value) and removeCustomLevel(name)
to LogManager. For testing purposes, but also of general use, adds
clearAppenders() and getAppenders().  Adding a custom level adds a
method of the corresponding name to the Logger interface.  This change
is needed to enable the logger to replace console for existing functions
like trace, time/timeEnd, etc, as well as to support custom behavior
for additional logging use cases. In my case, I need an exception()
method to format passed error stacks to submit to an error reporting
service.

There should be no breaking changes. Closes issue aurelia#33.

krisdages added a commit to krisdages/aurelia-logging that referenced this issue Nov 1, 2017

feat(log-manager): add custom log levels
Adds methods addCustomLevel(name, value) and removeCustomLevel(name)
to LogManager. For testing purposes, but also of general use, adds
clearAppenders() and getAppenders().  Adding a custom level adds a
method of the corresponding name to the Logger interface.  This change
is needed to enable the logger to replace console for existing functions
like trace, time/timeEnd, etc, as well as to support custom behavior
for additional logging use cases. In my case, I need an exception()
method to format passed error stacks to submit to an error reporting
service.

There should be no breaking changes. Closes issue aurelia#33.

krisdages added a commit to krisdages/aurelia-logging that referenced this issue Nov 1, 2017

feat(log-manager): add custom log levels
Adds methods addCustomLevel(name, value) and removeCustomLevel(name)
to LogManager. For testing purposes, but also of general use, adds
clearAppenders() and getAppenders().  Adding a custom level adds a
method of the corresponding name to the Logger interface.  This change
is needed to enable the logger to replace console for existing functions
like trace, time/timeEnd, etc, as well as to support custom behavior
for additional logging use cases. In my case, I need an exception()
method to format passed error stacks to submit to an error reporting
service.

There should be no breaking changes. Closes issue aurelia#33.
@Alexander-Taran

This comment has been minimized.

Show comment
Hide comment
@Alexander-Taran

Alexander-Taran Mar 1, 2018

Member

Can be closed?

Member

Alexander-Taran commented Mar 1, 2018

Can be closed?

@EisenbergEffect

This comment has been minimized.

Show comment
Hide comment
@EisenbergEffect

EisenbergEffect Mar 1, 2018

Member

Covered by custom log levels.

Member

EisenbergEffect commented Mar 1, 2018

Covered by custom log levels.

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