-
Notifications
You must be signed in to change notification settings - Fork 35
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
fix: log to console using structured logging #780
Conversation
Replaces 'console-log-level' with '@google-cloud/logging-min' to write logs to stdout.
Rolls back to accept a string message for Logger methods. Replaces new line with its escape notation '\\n'. Refactors single location that prints array to print a single string.
Codecov Report
@@ Coverage Diff @@
## main #780 +/- ##
==========================================
- Coverage 69.97% 69.15% -0.83%
==========================================
Files 7 7
Lines 1209 1248 +39
Branches 57 58 +1
==========================================
+ Hits 846 863 +17
- Misses 362 384 +22
Partials 1 1
Continue to review full report at Codecov.
|
@bcoe can you help me to troubleshoot the reasons for check failures, please? |
Test fails will be fixed with mapbox/node-pre-gyp#623 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments inside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, see if you agree with those
ensure to pass test to not accept node@10.4.0
add new line at the end of the package.json. add constants for max and min logging levels. add handling windows new line in the multiline log payload.
🤖 I have created a release \*beep\* \*boop\* --- ### [4.1.6](https://www.github.com/googleapis/cloud-profiler-nodejs/compare/v4.1.5...v4.1.6) (2021-12-20) ### Bug Fixes * log to console using structured logging ([#780](https://www.github.com/googleapis/cloud-profiler-nodejs/issues/780)) ([6b96e00](https://www.github.com/googleapis/cloud-profiler-nodejs/commit/6b96e007418bd6074c2bf9de64df0742e6a6d4ae)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Replace package
console-log-level
with@google-cloud/logging-min
. Use LogSync class of the logging package to print structured logging tostdout
to capture the correct severity level.Also handle a case of printing multi-line log that is captured as multiple log entries.