-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
bugfix/aura-logging #692
bugfix/aura-logging #692
Conversation
… function for setting the scenario field in log entry events
…/ZackFra/NebulaLogger into feature/fix-lwc-and-aura-logging
… for setting the scenario field in log entry events
…zing the logger service
…ecifying a scenario
Feature/fix-lwc-and-aura-logging
…s the LoggerService to be created synchronously
…fter the settings are loaded if no log entries meet the logging level criteria
@ZackFra thanks for reporting this & submitting a PR! And apologies for the late response, I've had limited time lately to work on open source stuff, but hope to give this a more thorough review in the coming weeks. Offhand, I have a couple of concerns with this PR - it looks like it changes/breaks logging in existing aura components & LWCs
_meetsUserLoggingLevel(logEntryLoggingLevel) {
// return true until settings are loaded
if(!this.#isSettingsLoaded) {
return true;
}
...
} I'll review + test this more ASAP! |
I'm closing this PR, and will instead merge #727, which moves JS stack trace parsing to happen in JS directly (instead of in Apex). Some of the changes in this PR have been incorporated into #727, but since the entire architecture was changed, it was cleaner to create a new branch/PR for it. Some related info for extra context & future reference:
|
Found that trying to log via aura components didn't format correctly. Raised an issue about it.
I expect this to get rejected, since I am aware that some of the Logger_Test methods are failing. Didn't want to mess with them without some sort of input. Looks like they might be using old stack traces that Salesforce doesn't generate anymore, that's my best guess anyway.
In a nutshell, found that aura components can't pull in the createLogger function that's exported by the logger lwc, and the stack trace captured by info, debug, etc. won't capture the aura component in the stack trace when you call them from component (i.e. component.find('logger').info('...').
Updated the logger LWC to have a createLogger function that exports
this
. After calling this new createLogger function, it works correctly.There were issues with generating the stack trace in JS when used in a callback (i.e. createLogger().then( () => { ... }) so refacted createLogger to be synchronous, and to use JIT logic to pull in the settings. i.e. if the settings aren't loaded, saveLog will just await the this.#settingsPromise until it resolves.
Updated the LoggerStackTrace apex class to parse the stack traces from JavaScript with updated logic.