This repository was archived by the owner on Feb 20, 2026. It is now read-only.
fix: log to console using structured logging#780
Merged
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.
|
Contributor
Author
|
@bcoe can you help me to troubleshoot the reasons for check failures, please? |
Contributor
Author
|
Test fails will be fixed with mapbox/node-pre-gyp#623 |
losalex
approved these changes
Dec 14, 2021
losalex
approved these changes
Dec 16, 2021
losalex
left a comment
There was a problem hiding this comment.
Left some comments, see if you agree with those
ensure to pass test to not accept [email protected]
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.
bcoe
approved these changes
Dec 20, 2021
gcf-merge-on-green Bot
pushed a commit
that referenced
this pull request
Dec 20, 2021
🤖 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace package
console-log-levelwith@google-cloud/logging-min. Use LogSync class of the logging package to print structured logging tostdoutto capture the correct severity level.Also handle a case of printing multi-line log that is captured as multiple log entries.