Skip to main content

Simple logging and benckmark decorator

Project description

Project logo

Kami Logging

Status GitHub release issues - kami-logging pulls - kami-logging License


Simple decorator to logging and benchmark functions

📝 Table of Contents

🧐 About

This package arose from the need to simplify the logging tasks of applications created by the Kami CO software development team.

Currently the package has 4 decorators: benchmark_with, logging_with, default_logging and default_benchmark for logging and basic performance testing with or without a defined logger object;

🏁 Getting Started

These instructions will get you a copy of the package and a daily use example.

Prerequisites

  • Python 3.x
  • logging library

Installing

$pip install kami-logging

🎈 Usage

The four decorators available are:

  • @logging_with: generates a log message of type info at the beginning and end of the function execution, using a logger object defined by the developer

  • @default_logging: generates a log message of type info at the beginning and end of function execution, using a default logger object named 'default'

  • @benchmark_with: Generates a log message of type info with the runtime of the function accurate to 3 decimal places, using a developer-defined logger object

  • @default_benchmark: generates a log message of type info with the runtime of the function accurate to 3 decimal places, using a default logger object named 'default'

import logging
from kami_logging import logging_with, benchmark_with

my_app_logger = logging.getLogger("my_app")

@benchmark_with(my_app_logger)
@logging_with(my_app_logger)
def my_func(*args, **kwargs):
  pass

Result:

Project logo

⛏️ Built Using

✍️ Authors

See also the list of contributors who participated in this project.

🎉 Acknowledgements

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

kami_logging-0.2.1.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

kami_logging-0.2.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file kami_logging-0.2.1.tar.gz.

File metadata

  • Download URL: kami_logging-0.2.1.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.9.2 Linux/5.10.0-18-amd64

File hashes

Hashes for kami_logging-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f91d702e57410723146491135614f3e0039cb1e5cda651cb8139ee9f828ced37
MD5 bf5c19313518a70dd28dd611550fd78b
BLAKE2b-256 15d9c75d3b05d0ae532fe80b74d2d6702aa17a9ebb23e66874fc3eb530d1b683

See more details on using hashes here.

File details

Details for the file kami_logging-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: kami_logging-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.9.2 Linux/5.10.0-18-amd64

File hashes

Hashes for kami_logging-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ac4b7545e5969d745db2aa2311239ca3b20da3d05157c7e24670cf5b9406027
MD5 01f206fb5492889e4dfa1e239fe89203
BLAKE2b-256 20f9e1d139877a77089cc6e370f5762f0d5854354b9320b22645b1d1ff34876b

See more details on using hashes here.

Supported by

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