PavLogger provides the ability to log debug and exception to a text file or a SQLite database with optional Backtrace output.
Project description
PavLogger
This currently provides a easy to use sqlite and postgres database commands. If you install SQLCypher, the library can also handle the encryption of the database.
Installation
Run the following to install:
pip install pav_logger
Usage
Optional:
log_name:
Provides a way to specify another log file name:
Default: debug and exception
show_backtrace:
Provides a way to specify to show the backtrace of an message
Default:
Debug: False
Error: True
log_severity:
Provides a way to specify a number for the log for SQLite database
Default:
Debug: 0
Error: 4
line_divider:
Provides a way to change the dividing line between messages.
Default:
'#'
import pav_logger
pav_logger = pav_logger.PavLogger()
pav_logger.log_path = "<Location Folder Path>"
pav_logger.debug('This is a debug message.')
try:
raise ValueError('There is an error')
except Exception as error:
pav_logger.error(error)
pav_logger.log_to_database = True
pav_logger.debug('This is a debug message.')
try:
raise ValueError('There is an error')
except Exception as error:
pav_logger.error(error)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pav_logger-1.0.1.tar.gz
(3.8 kB
view hashes)
Built Distribution
pav_logger-1.0.1-py3-none-any.whl
(16.4 kB
view hashes)
Close
Hashes for pav_logger-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 856a4be1eedbb36514b4246e0e303194f9cf196b5c3e1f72544e9689d26811cb |
|
MD5 | 8fc3329ee1351a13d482cbfb1099781b |
|
BLAKE2b-256 | 0dab1bfdfad734dbcde79fabf3bab09f611e07608e1e2d6b51fbc41f3935d5b3 |