v4.14.13 - New synchronous JavaScript function getLogger() + deprecated async function createLogger() #779
jongpie
announced in
Announcements
Replies: 2 comments 3 replies
-
Awesome stuff! |
Beta Was this translation helpful? Give feedback.
1 reply
-
@jongpie You do a great job getting releases out so often adding new features and supporting issues. There are so many releases between NebulaLogger and ApexRollup that I feel like I need to set up a pipeline to upgrade them regularly instead of doing it manually. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This release is focused on several enhancements & bugfixes for logging in JavaScript (aura & lightning web components). Thanks to @jamessimone for reviewing & discussing the changes for this release, and thanks to @srikanth3107 for reporting issue #776!
Core Unlocked Package Changes
New
getLogger()
functionPartially fixed #728 by adding a new function
getLogger()
inlogger
LWC that can be called synchronously, and deprecated the async functioncreateLogger()
logger
LWC, and avoids some lingering JavaScript (JS) stack trace issues that occur inasync
functionscreateLogger()
is still supported & functional, but it's now considered deprecated since it requires usingawait
(which is no longer necessary withgetLogger()
)Note
This does not truly "fix" or improve the stack trace parsing used in
async
functions, andasync
functions will continue to have inaccurate function names reported in some browsers (typically,eval
is listed as the function name). This is a ongoing challenge in JavaScript due to what info is/isn't available in stack traces in some browsers (most notably, webkit browsers like Chrome & Edge).But with the new
getLogger()
function, Nebula Logger no longer requires the use ofasync
/await
- and often the only reason developers were usingasync
/await
was to be able to use Nebula Logger. In these situations, developers can eliminateasync
/await
, and the resulting log entries will have accurate JS function names.Example: Old
createLogger()
UsagePreviously, JS developers had to use
async
,await
, and truthy checks to ensure that Nebula Logger's LWC had finished being loaded. This resulted in more complexity for developers, who just want to be able to log some stuff 😢Example: New
getLogger()
UsageNow,
await
is no longer needed, and alogger
instance can be immediately initialized & used. This results in less code, and happier developers 🥳New
exception()
functionResolved #763 by adding a JS function equivalent to the Apex method
Logger.exception()
. Both of these do 3 things in 1 line of code:Previously in JS, this would have been 3 lines of code:
Now, 1 line of code provides the same functionality:
More Improvements for JS Stack Trace Parsing
Fixed #776 by updating logic in
loggerStackTrace.js
to better handle parsing when lightning debug mode is disabledPreviously, stack traces worked when debug mode was enabled, but was still inaccurate in some browsers when debug mode was off due to some subtle differences in the generated stack traces.
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.14.12...v4.14.13
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oW3QAI
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015oW3QAI
This discussion was created from the release New synchronous JavaScript function getLogger() + deprecated async function createLogger() .
Beta Was this translation helpful? Give feedback.
All reactions