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

bugfix/aura-logging #692

Closed
wants to merge 25 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
22374ee
got the logger working with aura components
ZackFra May 25, 2024
c3250b1
Got the logger working with aura components
ZackFra May 25, 2024
39e62da
Delete manifest/package.xml
ZackFra May 25, 2024
52768dd
Refactor logEntryBuilder.js and loggerService.js to use setScenario()…
ZackFra May 26, 2024
73a58cd
Merge branch 'feature/fix-lwc-and-aura-logging' of https://github.com…
ZackFra May 26, 2024
48b0019
Refactor logger.js and loggerService.js to use setScenario() function…
ZackFra May 26, 2024
4062f80
Refactor logger.js to use createLoggerService() function for initiali…
ZackFra May 26, 2024
bd5f201
Refactor loggerAuraDemoController.js to use createLogger() without sp…
ZackFra May 26, 2024
9e0b56d
Refactor createLogger() function in logger.js to include return type …
ZackFra May 26, 2024
1781ce8
Refactor logger.js to remove unused import of COMPONENT_TYPES
ZackFra May 26, 2024
d4d9832
Refactor logger.js to allow Aura components to access Logger instance
ZackFra May 26, 2024
cf1cb22
Merge pull request #2 from ZackFra/feature/fix-lwc-and-aura-logging
ZackFra May 26, 2024
9541e0b
Moved the logger logic to the logger service
ZackFra May 26, 2024
b830f74
Updated the logger service to use JIT loading for the settings, allow…
ZackFra May 26, 2024
bca3f12
No need for createLoggerService to be async anymore
ZackFra May 26, 2024
28572fd
cleaned up try/catch
ZackFra May 26, 2024
d5cc192
Cleaned up comments
ZackFra May 26, 2024
e9e1373
Tweaked logger service's JIT logic to ensure a save isn't attempted a…
ZackFra May 26, 2024
988a2c8
Cleaned up the setStack logic
ZackFra May 26, 2024
ef1a056
Got rid of "createLogger" on component, found it wasn't needed now.
ZackFra May 26, 2024
2d2f16f
Stand corrected, added it back in.
ZackFra May 26, 2024
c696ec5
Changed the order of where the JIT logic occurs
ZackFra May 26, 2024
b36d7b1
Removed unused function
ZackFra May 26, 2024
1e763a4
Updated comment
ZackFra May 26, 2024
31d5595
made _newEntry's addition consistent with other logic
ZackFra May 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed the order of where the JIT logic occurs
ZackFra committed May 26, 2024
commit c696ec5d78733f56a3b56552d6504dafb71c6b87
Original file line number Diff line number Diff line change
@@ -76,13 +76,6 @@ export const LoggerService = class {
* on subsequent saveLog() calls
*/
async saveLog(saveMethodName) {
if (this.#componentLogEntries.length === 0) {
return;
}
if (!saveMethodName && this.#settings?.defaultSaveMethodName) {
saveMethodName = this.#settings.defaultSaveMethodName;
}

// some JIT logic here to load settings if they haven't been loaded yet
if(!this.#isSettingsLoaded) {
// may not be loaded if you trigger the log before the promise resolves
@@ -91,10 +84,14 @@ export const LoggerService = class {
this.#componentLogEntries = this.#componentLogEntries.filter(
logEntry => this._meetsUserLoggingLevel(logEntry.loggingLevel)
);
if(this.#componentLogEntries.length === 0) {
return;
}
}
}

if (this.#componentLogEntries.length === 0) {
return;
}
if (!saveMethodName && this.#settings?.defaultSaveMethodName) {
saveMethodName = this.#settings.defaultSaveMethodName;
}

try {
const logEntriesToSave = [...this.#componentLogEntries];