Skip to content
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

Aura/LWC stack trace parsing is not accurate when lightning debug mode is disabled #776

Closed
srikanth3107 opened this issue Oct 9, 2024 · 5 comments · Fixed by #775
Closed
Assignees
Labels
Layer: Logger Engine Items related to the core logging engine Logging Source: Lightning Components Items related to using Nebula Logger using JavaScript within lightning components (lwc & aura) Type: Bug Something isn't working

Comments

@srikanth3107
Copy link

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

4.14.12

New Bug Summary

Hi @jongpie @ZackFra ,

I installed 4.14.12 version unlocked package , when i try to log for LWC ,the stack trace is not clear still the same issue persists for me what @ZackFra attached image ,i am using chrome .

This is the below code i am using

      <template>
        <c-logger></c-logger>
        <div>Nebule Logger Component</div>
        <lightning-button variant="base" label="click To Log" title="" onclick={log} class="slds-m-left_x-small">      
        </lightning-button>
       </template>

JS
log() {

const logger = this.template.querySelector('c-logger');

 logger.error('ERROR!!!').addTag('TAG');

logger.warn('WARN!!!');

logger.info('INFO!!!');

logger.debug('DEBUG!!!');

logger.fine('FINE!!!');

logger.finer('FINER!!!');

logger.finest('FINEST!!!');

logger.saveLog();

}

Can you please help us with that

@srikanth3107 srikanth3107 added the Type: Bug Something isn't working label Oct 9, 2024
@srikanth3107
Copy link
Author

nebulla error

@jongpie
Copy link
Owner

jongpie commented Oct 10, 2024

@srikanth3107 I think I see what the issue is - it seems to be related to whether or not you have lightning debug mode enabled for your user. Can you check a few things in your org to help validate this?

  • In your org, for your user, verify that lightning debug mode is not enabled
  • In your org, enable lightning debug, and see if the stack traces/origin fields are correct
    • You can enable/disable lightning debug in your org under Setup --> Lightning Components --> Debug Mode

      image

@jongpie jongpie added 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 labels Oct 10, 2024
@jongpie jongpie self-assigned this Oct 10, 2024
@srikanth3107
Copy link
Author

@jongpie Thanks for your time quick response . It fixed the issue.
You made whole debugging simple and easy, Thanks!!

@jongpie jongpie reopened this Oct 10, 2024
@jongpie
Copy link
Owner

jongpie commented Oct 10, 2024

Thanks @srikanth3107. I'm re-opening the issue for now, this is still a bug - having lightning debug mode enabled shouldn't be required to get accurate stack traces. I have a fix for the issue, it'll be included in PR #775.

@jongpie jongpie changed the title LWC stack Trace is not properly coming Aura/LWC stack trace parsing is not accurate when lightning debug mode is disabled Oct 10, 2024
jongpie added a commit that referenced this issue Oct 10, 2024
…parsing when lightning debug mode is disabled

Previously, stack traces worked when debug mode was enabled, but was inaccurate when debug mode was off due to some subtle differences in the generated stack traces

Also incorporated some code review feedback from @jamessimone

Also removed opera stack trace parsing in loggerStackTrace.js - there was no test coverage for this, I haven't heard of anyone using Opera in years, and I just... don't want to have to test another browser. If/when someone says Opera support is needed, it can be revisited[D
@jongpie
Copy link
Owner

jongpie commented Oct 11, 2024

@srikanth3107 this is now fixed in release v4.14.13 - Aura & LWC stack traces should now be accurate when lightning debug mode is enabled or disabled.

Thanks again for reporting this!

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