Skip to content

LWC - Logs not created when using new createLogger pattern #515

Answered by jongpie
shuylern asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @shuylern, thanks for doing some investigation on this! It sounds like a bug in the new createLogger() function - adding new entries happens asynchronously, but the saveLog() function runs synchronously, so in lifecycle events like connectedCallback(), saving seems to be problematic. The saveLog() function in logger needs to be enqueued so it runs after adding entries.

I've made a bug for this, #518 - I'll see if there's a quick & effective way to get this resolved in the coming weeks.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jongpie
Comment options

Answer selected by shuylern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Type: Bug Something isn't working Logging Source: Lightning Components Items related to using Nebula Logger using JavaScript within lightning components (lwc & aura) Layer: Logger Engine Items related to the core logging engine
2 participants