v4.14.17 - Added more details in logger LWC's console statements #793
jongpie
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Core Unlocked Package Changes
When using the
logger
LWC and JavaScript console logging is enabled (viaLoggerSettings__c.IsJavaScriptConsoleLoggingEnabled__c
), Nebula Logger automatically calls functions in the browser'sconsole
so devs can easily see the generated log entry directly in their browser (instead of having to find it inLogEntry__c
). This release improves the component log entry JSON that's printed usingconsole
statements - the stringified object now includes more details, such as details about the logged error/exception (when an error is logged), any tags added to the entry, and the user's localized version of the entry'stimestamp
.console
functions: now,console
functions are called with a 1 second delay (usingsetTimeout()
) so that additional details can be added to the log entry (using the builder methods) before the log entry is stringified & printed out. This may not be a perfect solution, but seems to work in most cases of using the JS builder methods.To show the difference in the changes, this JavaScript was used to generate some example log entries:
In the screenshot below, 2 versions of the output are shown:
setExceptionDetails()
.console
statements' outputconsole
output. This keeps the output slimmer & easier to read.new Date().toISOString()
) and in the user's local format (usingnew Date().toLocaleString()
). This makes it a little easier for devs to troubleshoot exactly when an entry was generated in their browser.Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.14.16...v4.14.17
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015ocRQAQ
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015ocRQAQ
This discussion was created from the release Added more details in logger LWC's console statements.
Beta Was this translation helpful? Give feedback.
All reactions