This lib will help you to send your app's logs to LogCenter.
Project description
LogCenter.Logger
This lib will help you to send your app's logs to LogCenter.
Each log entry is queued and will be sent in order, following a FIFO (First In, First Out) approach.
This ensures that logs are processed sequentially, maintaining the correct logging sequence.
Getting Started
Basic usage
First install the lib from Nuget
pip install LogCenter --no-cache-dir
Initialize the logger with you LogCenter configs
from LogCenter import LogCenterOptions,LogCenterLogger, LogLevel
options = LogCenterOptions(
url="http://localhost:9200",
table="example dotnet console", //the spaces will be converted to _ (underscore).
token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....", //Generate this on LogCenter inteface, on you profile photo.
)
logger = LogCenterLogger(options)
Logging a simple message async, in the background without blocking code execution
// Use this
logger.LogAsync(LogLevel.INFO, "Hello World")
Logging a simple message syncronous in foreground, blocking code execution.
// Use this
logger.Log(LogLevel.ERROR, "Hello World")
Logging an object in the background without blocking code execution. You can use any type of object, which will be converted to JSON before being sent to LogCenter.
logger.LogAsync(LogLevel.CRITICAL, "This is just an example", {
"nome": "John Doe Jr. da Silva",
"idade": 30,
"CPF": "123.456.789-00",
"email": "john.doe.jr@example.com",
"telefone": "11 91234-5678",
"cep": "04545-000",
"logradouro": "Rua Professor Atílio Innocenti, 165",
"bairro": "Vila Nova Conceição",
"cidade": "São Paulo",
"uf": "SP",
"pais": "Brasil",
"dataDeNascimento": str(uuid.uuid4()), # Simulação de data
"altura": 1.80,
"peso": 70.5,
"descricao": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"
})
Build Package
python -m build # must be installed before
twine upload dist/* # must be installed before
pip install LogCenter --no-cache-dir
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logcenter-0.1.3.tar.gz.
File metadata
- Download URL: logcenter-0.1.3.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d590d220c1e78a6e508a2b6480b421768f7d3ce286008f6350f0a642c5640f5
|
|
| MD5 |
5b7dc430d2d9caee77970a04aedd472b
|
|
| BLAKE2b-256 |
8ed4b9b3f464a95c420ca4eb05bdc20e34c5b61bbf49853a701dd06176930811
|
File details
Details for the file logcenter-0.1.3-py3-none-any.whl.
File metadata
- Download URL: logcenter-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c064d386bebcdb4437418023cb41e2623b1f226ea805c60480214585630cab4
|
|
| MD5 |
22a9630f6685c69ed6c14f966e211c35
|
|
| BLAKE2b-256 |
74515a9841b29c7176e9ce4a6d01566563d6da9749cede320af069159c1c22e9
|