diff options
author | ael-code <tommy.ael@gmail.com> | 2016-11-09 01:26:06 +0100 |
---|---|---|
committer | ael-code <tommy.ael@gmail.com> | 2016-11-25 17:34:57 +0100 |
commit | 3c8086ece60c839eaaac868678415a5e85eb13db (patch) | |
tree | 52e8df6f4da51f761f9aa0c1b585c95789274712 /tests | |
parent | 601b6f8ff008c1d94351a6300816d898f08531f3 (diff) | |
download | ranger-3c8086ece60c839eaaac868678415a5e85eb13db.tar.gz |
Make use of standard logging library to handle logs
The goal is to provide an easy api to log stuff and a straigthforward way of inspect them. This has been achieved using the standard logging library. The default behaviour is pretty similar to the old one, in the sense that all the the produced logs will be collected in a queue that can be inspected with the curses log viewer (`display_log` command). Moreover the `--logfile` cli option has been added and it can be used to specifya destination file for all the logs in such a way that the same log can be viewed at runtime as well as inspected after a program crash. The verbosity and the format of the log message is controlled by the already existent `--debug` command line flag: - Normal mode: A concise log format will be used and only important message will be logged (log level > INFO) Example: ``` [INFO] Ranger version 1.7.2 [INFO] Running on Python 3.5.2 (default, Jun 28 2016, 08:46:01) [GCC 6.1.1 20160602] [INFO] Process ID is 1497 ``` - Debug mode: An extended log format will be used and all the message will be logged. Example: ``` 23:17:43,719 [ranger.core.main] |INFO| Ranger version 1.7.2 23:17:43,719 [ranger.core.main] |INFO| Running on Python 3.5.2 (default, Jun 28 2016, 08:46:01) [GCC 6.1.1 20160602] 23:17:43,719 [ranger.core.main] |INFO| Process ID is 1515 23:17:43,720 [ranger.core.main] |DEBUG| config dir: '/home/groucho/.config/ranger' 23:17:43,720 [ranger.core.main] |DEBUG| cache dir: '/home/groucho/.cache/ranger' 23:17:43,738 [ranger.core.actions] |DEBUG| Sourcing config file '/path/to/ranger/config/rc.conf' ``` fixes #713
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions