From 3b3ef77d5f0e5cc392d9ed427b953d8dfa0d2be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sat, 16 Mar 2019 17:17:10 +0100 Subject: [PATCH] Added logging --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index 759d4fd..5e975d0 100644 --- a/README.md +++ b/README.md @@ -1657,6 +1657,46 @@ def get_border(screen): ``` +Logging +------- +```python +# $ pip3 install loguru +from loguru import logger +``` + +```python +logger.add('debug_{time}.log', colorize=True) # Connects a log file. +logger.add('error_{time}.log', level='ERROR') # Adds another file for errors or higher. +logger.('A logging message') +``` +* **Levels: `'debug'`, `'info'`, `'success'`, `'warning'`, `'error'`, `'critical`'.** + +### Rotation +Parameter that sets a condition when a new log file is created. +```python +rotation=||| +``` +* **`''` - Max file size in bytes.** +* **`'`' - Max age of a file.** +* **`'