Skip to main content

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


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.9.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

falcon_logging-0.3.9-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file falcon-logging-0.3.9.tar.gz.

File metadata

  • Download URL: falcon-logging-0.3.9.tar.gz
  • Upload date:
  • Size: 4.4 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.8.10

File hashes

Hashes for falcon-logging-0.3.9.tar.gz
Algorithm Hash digest
SHA256 1b196e4e5c1928867348147a193c31280dafdd41b47abd17a53e4af21abcfe46
MD5 9c1dc5d98ce5a85a4d3dcd0c80af0a56
BLAKE2b-256 dd60ac050645f2c07739e64a68465bb53b3dd78e0768caafbf84efef45249cc8

See more details on using hashes here.

File details

Details for the file falcon_logging-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: falcon_logging-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • 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.8.10

File hashes

Hashes for falcon_logging-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 98f41bc3ce845ad021ef7854703d257f72999626ecf897ed5315f1093de4d66a
MD5 4ca39749d870ce20babe373e17654205
BLAKE2b-256 c31b33289522be77d096d3542b1e151e271f2cd6eb7571198b15ab7f72bfed65

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page