Skip to content
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

New logging implementation #703

Merged
merged 14 commits into from Feb 16, 2019

Conversation

aoberoi
Copy link
Contributor

@aoberoi aoberoi commented Feb 15, 2019

Summary

Implements ConsoleLogger, which allows us to remove loglevel dependency.

Refactors objects to use the new ConsoleLogger.

Refines the Logger interface.

Accept Logger objects for the logger option on WebClient, RTMClient, and KeepAlive.

Adjusts documentation for deprecation of LoggingFunc

Fixes #692

Requirements (place an x in each [ ])

@aoberoi aoberoi marked this pull request as ready for review February 15, 2019 03:10
@codecov
Copy link

codecov bot commented Feb 15, 2019

Codecov Report

Merging #703 into master will increase coverage by 1.97%.
The diff coverage is 89.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #703      +/-   ##
==========================================
+ Coverage   91.97%   93.94%   +1.97%     
==========================================
  Files           7        7              
  Lines         486      446      -40     
  Branches       91       43      -48     
==========================================
- Hits          447      419      -28     
- Misses         22       25       +3     
+ Partials       17        2      -15
Impacted Files Coverage Δ
src/util.ts 80.85% <ø> (+3.07%) ⬆️
src/WebClient.ts 95.8% <100%> (+2.13%) ⬆️
src/logger.ts 89.79% <87.8%> (+0.32%) ⬆️
src/retry-policies.ts 100% <0%> (ø) ⬆️
src/IncomingWebhook.ts 92.59% <0%> (+5.09%) ⬆️

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 374fd1e...0bff647. Read the comment docs.

@@ -307,10 +307,31 @@ not log anything as long as nothing goes wrong.
You can adjust the log level by setting the `logLevel` option to any of the values found in the `LogLevel` top-level
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we list out the options here?

@@ -426,8 +426,31 @@ not log anything as long as nothing goes wrong.
You can adjust the log level by setting the `logLevel` option to any of the values found in the `LogLevel` top-level
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above comment

| `error()` | `...msgs: any[]` | `void` |


**NOTE**: The option can also take a function with the following signature, but this usage is deprecated:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested edit: "While the use of logging functions is deprecated, the logger option will still currently accept a function if the method signature matches fn(level: string, message: string)."

The main thing I want to change is for the deprecation part to be at the beginning of the note.

@aoberoi
Copy link
Contributor Author

aoberoi commented Feb 16, 2019

89.36% of diff hit (target 91.97%)

i'm going to override this failure because the lines that are not hit are lines that will be likely removed in v5 (they are in the compatibility layer for logging functions).

@aoberoi aoberoi merged commit 6b1af92 into slackapi:master Feb 16, 2019
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.

None yet

2 participants