Skip to content

Commit

Permalink
Prefix all library errors
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgeary committed Aug 30, 2024
1 parent f064f26 commit 9d55524
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion projects/demo/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import { AppComponent } from './app/app.component';

bootstrapApplication(AppComponent, appConfig)
// eslint-disable-next-line unicorn/prefer-top-level-await, no-console -- it's a pretty fatal error
.catch(error => console.error(error));
.catch(error => console.error('LOG4NGX:', error));
10 changes: 5 additions & 5 deletions projects/log4ngx/src/lib/appenders/localstorage-appender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class LocalStorageAppender extends Appender {
this.getCurrentLogEntries(this._localStorage); /* Really just to initialize _currentKey and _currentLogEntries */
} else {
// eslint-disable-next-line no-console -- there's not much else we can do
console.error('LocalStorage is not available; calls to log via LocalStorageAppender will be ignored');
console.error('LOG4NGX: LocalStorage is not available; calls to log via LocalStorageAppender will be ignored');
}
}

Expand Down Expand Up @@ -89,11 +89,11 @@ export class LocalStorageAppender extends Appender {
/* Remove all but the current day's logs */
retry = this.removeOldLogKeys(1);
// eslint-disable-next-line no-console -- nowhere else we can note this
console.warn(retry ? 'LocalStorage quota has been exceeded; old logs removed so will retry logging'
: `LocalStorage quota has been exceeded (${error})`);
console.warn(retry ? 'LOG4NGX: LocalStorage quota has been exceeded; old logs removed so will retry logging'
: `LOG4NGX: LocalStorage quota has been exceeded (${error})`);
} else {
// eslint-disable-next-line no-console -- nowhere else we can note this
console.warn(`Error occurred logging entry to (${error})`);
console.warn(`LOG4NGX: Error occurred logging entry to (${error})`);
}
}
} while (retry);
Expand Down Expand Up @@ -154,7 +154,7 @@ export class LocalStorageAppender extends Appender {

if (handled) {
// eslint-disable-next-line no-console -- nowhere else we can note this
console.info('Log entries purged from LocalStorage');
console.info('LOG4NGX: Log entries purged from LocalStorage');
}

return handled;
Expand Down

0 comments on commit 9d55524

Please sign in to comment.