Skip to main content

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

Release files for kami-logging 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kami-logging 0.2.1
File Size Uploaded
kami_logging-0.2.1.tar.gz 15.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kami-logging 0.2.1
File Interpreter ABI Platform
kami_logging-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 31.7 kB

Release files / kami_logging-0.2.1.tar.gz

Download URL kami_logging-0.2.1.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f91d702e57410723146491135614f3e0039cb1e5cda651cb8139ee9f828ced37
BLAKE2b-256 checksum
How to use checksums
15d9c75d3b05d0ae532fe80b74d2d6702aa17a9ebb23e66874fc3eb530d1b683
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.0 CPython/3.9.2 Linux/5.10.0-18-amd64

Release files / kami_logging-0.2.1-py3-none-any.whl

Download URL kami_logging-0.2.1-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ac4b7545e5969d745db2aa2311239ca3b20da3d05157c7e24670cf5b9406027
BLAKE2b-256 checksum
How to use checksums
20f9e1d139877a77089cc6e370f5762f0d5854354b9320b22645b1d1ff34876b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.0 CPython/3.9.2 Linux/5.10.0-18-amd64

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page