Home > gnome-shell-logger

gnome-shell-logger

Gnome-shell-logger is a project mainly written in JavaScript, it's free.

A file logger for Gnome Shell

Abstract

This program adds the ability of logging to a file the debug and error messages produced by GnomeShell and its extensions. The log file is written in /tmp/gshell.log by default, but you can change this and other options editing the file logger.js

Credits

  • The log4javascript library was written by Tim Down and is licensed under the terms of the Apache License, Version 2.0.

  • The files log4javascript_file_appender.js and log4javascript_gjs_appender.js was written by Tim Cuthbertson and are licensed under the terms of the GNU General Public License version 3 or later.

  • The file logger.js was written by Antonio Hernández and is licensed under the terms of the GNU General Public License version 2 or later.

Installation and usage

The program is intended to be used as a GnomeShell module, so you must copy the logger directory under /usr/share/gnome-shell/js/ and include the module in main.js with this line:

const Logger = imports.logger.logger;

All the messages sent to the default Gnome Shell logger, that is, calling global.log(), will also be send to log4javascript.

You can also use the logger directly by calling the following methods:

global.logger.debug() global.logger.info() global.logger.warn() global.logger.error() global.logger.fatal()

Tip: If you want to see the messages produced by Gjs in gshell.log you can start GnomeShell this way from a tty:

DISPLAY=:0 gnome-shell --replace 2&>>/tmp/gshell.log

License

This project is licensed under the terms of the GPL v2.0, see http://www.gnu.org/licenses/gpl-2.0.html

Previous:smart_prince