Logging Wrapper for Falcon Web Framework with Cloud Logging
Project description
Wrapper para trabalhar com a API do Cloud Logging
Procedimento para upload no PYPI
Pré requisitos
Instalar pacotes python
python3 -m pip install --upgrade setuptools build wheel twine
Build e enviar ao PYPI
python3 -m build
python3 -m twine upload dist/*
Instalar o pacote no projeto
pip install falcon-logging
Utilização da biblioteca
Essa biblioteca espera que você passe o schema dos dados da tabela.
É aconselhado criar um arquivo de schema.py ou model.py onde seja definido a estrutura de dados da tabela.
Instanciar o Middleware
Com o schema definido, você deve instanciar um classe
from falcon_logging.logging import LogMiddleware
import falcon
class HealthCheckResource(object):
def on_get(self, _, resp):
"""Handles GET requests"""
resp.status = falcon.HTTP_200
resp.body = 'OK'
def create():
middlewares=[LogMiddleware()]
_app = falcon.API(middleware=middlewares)
_app.add_route('/', HealthCheckResource())
return _app
app = create()
Principais operações
Usando a classe logging
, você pode executar algumas operações para auxiliar no desenvolvimento.
Logging
from falcon_logging.logging import logging
logging.info({"key": "value"})
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
falcon-logging-0.3.2.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for falcon_logging-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fa078dc5e30cd76ef961c89b81d91dfec9fdbcb616da5972dce96c34d0ba204 |
|
MD5 | 643a0c4e7d56a3985a047ab5e2f7c184 |
|
BLAKE2b-256 | 45fda1c494e6a47c6c1e70218d1e014acbeb01a8be6461dd1c0fdd0604a7ed6c |