sherlog
Usage
Default logger
By default, logger will record everything in the directory where you calling it
from sherlogger import logger
logger.info("Service is up...")
To change logs directory call .set_streams() method
from sherlogger import logger
from sherlogger import FileSystemHandler
logger.set_streams( # [<path_to_dirs>], <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.
telegram_logger will send messages in separated thread.
Custom logger
- Import
get_logger& handlers
from pathlib import Path
from sherlogger import get_logger, TelegramHandler, FileSystemHandler
ABS_PATH = Path().resolve()
logger = get_logger(__name__)
logger.basic_config(
handlers=[TelegramHandler, FileSystemHandler],
plugins_ini_path=f"{ABS_PATH}/plugins.ini",
level="INFO"
)
logger.set_streams(
["./logs/"], FileSystemHandler
)
logger.info("This is a message")
Metadata
Release files for sherlogger 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sherlogger-0.0.4.tar.gz | 7.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sherlogger-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.7 kB
Release files / sherlogger-0.0.4.tar.gz
| Download URL | sherlogger-0.0.4.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
691ef9a2855c57dca2155a88dc4124fc39b8f70bd5867f1840139dc1f38244f2
|
|
BLAKE2b-256 checksum How to use checksums |
ebd4e186f0c9290d73ca129e7bc5b1b8a2b56feaea10a406b01392cb5007d620
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.0
|
Release files / sherlogger-0.0.4-py3-none-any.whl
| Download URL | sherlogger-0.0.4-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53c8c837679cb255ff5ed997b1aa97c324c72b859896a92b1f610385c3cd7dcf
|
|
BLAKE2b-256 checksum How to use checksums |
d94764a179cd3dfd68e71339adc59b8c1b3dda971e9dae4e18a752e5438c0884
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.0
|
Security for sherlogger 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.