A simple logger class for MySQL and MariaDB
Project description
MySQLLogger
A simple logger class for MySQL and MariaDB
Installation
$ pip install mysql-logger
Usage example
from mysql_logger import MySQLLogger
# DB must be created before
db_settings = {
'user': 'username',
'password': 'Pa55w0rd',
'host': 'localhost',
'port': 3306,
'database': 'my_log_db'
}
# Table will be automatically created (if not exists)
table_name = 'software_name'
# Initialize the logger
logger = MySQLLogger(db_settings, table_name)
# Log messages
logger.info('log info level message')
logger.error('log error level message')
Dependencies
Changes
v0.0.1 (2021-10-05)
- Initial release.
- Logger levels: debug, info, warning, 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
mysql-logger-0.0.1.tar.gz
(3.2 kB
view details)
File details
Details for the file mysql-logger-0.0.1.tar.gz
.
File metadata
- Download URL: mysql-logger-0.0.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddca8da859f3dd730319f1dddf974156d831d06597f01e1937ab5f05651c43d0 |
|
MD5 | abd9c8690024b633a1676e68e62dfd58 |
|
BLAKE2b-256 | 29756ffa1d39500d9ec277362dae93a466c34360519291eea24c03ddda0971b5 |