Skip to content

Commit

Permalink
Change log() to console.log()
Browse files Browse the repository at this point in the history
The upgrade guidelines advise on using the normal js logging functions.
https://gjs.guide/extensions/upgrading/gnome-shell-45.html#logging
  • Loading branch information
Lucki committed Oct 21, 2023
1 parent 6f50912 commit fe45fdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class Logger {
sourceName = ` >> ${sourceInstance.constructor.name}`;

// This logs messages with GLib.LogLevelFlags.LEVEL_MESSAGE
log(`${LOG_PREFIX} [${LogLevel[level]}]${sourceName} :: ${errorMessage}`);
console.log(`${LOG_PREFIX} [${LogLevel[level]}]${sourceName} :: ${errorMessage}`);

// Log stack trace if available
if (message instanceof Error && message.stack)
// This logs messages with GLib.LogLevelFlags.LEVEL_WARNING
logError(message);
console.warn(message);
}

/**
Expand Down

0 comments on commit fe45fdc

Please sign in to comment.