Simple logger which can work with network!
Project description
sherlog
Usage
Default logger
By default, logger will record everything in the directory where you calling it
from sherlogger import logger
logger.info("THIS IS LOG MESSAGE")
To change logs directory call .set_stream()
method
from sherlogger import logger
from sherlogger import FileSystemHandler
logger.set_stream( # <path_to_dir>, <Handler>
"~/home/ubuntu/...", FileSystemHandler
)
logger.info("THIS IS LOG MESSAGE")
Telegram logger
Setup
-
.ini file
Create plugins.ini file. Format of file and required data is located in plugins.ini.example
Logger sends your message to telegram in asynchronous manner.
tlogger
will run in separated thread.
from pathlib import Path
from sherlogger import get_telegram_logger
ABS_PATH = Path().resolve()
logger = get_telegram_logger(
filename=__name__,
ini_file_path=f"{ABS_PATH}/plugins.ini"
)
logger.info("Some message")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sherlogger-0.0.3.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for sherlogger-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f3e8c26903d6b9081ee253916ba775a73f0c3423f924e5a29257245b692091b |
|
MD5 | 949a2452c3f140f05800ab53b781776a |
|
BLAKE2b-256 | 6c044d7f851e8b7ee9f49e8d75c3211cffa3152ed93eb5eec191e91d3d4a5e9b |