Skip to main content

This package provides sample loggers.

Project description

Deep Learning Tools for Pytorch

Python >= 3.8

This package provides some common configurations to quickly create your own logger through the logging library.

Installation

pip install sample_loggers

Example for using

To ues the logger directly, you can use the logger object provided by the package.

from sample_loggers import logger

logger.info("hello world!")

To define your own logger, you can use the create_logger method. This method allows you to specify the name of the logger and the log level.

from sample_loggers import create_logger, LEVEL

# The format can be defined as a string, 
# you can refer to the official website 
# https://docs.python.org/3/library/logging.html#logrecord-attributes.
define_format = "Define your own format here, you can use the default format or define your own format."

logger = create_logger(
    logger_name="logger",
    log_level=LEVEL.INFO,
    log_file_name="log.txt",
    output_dir="./output/log",
    format_type="default",
    define_format=define_format
)

Update

  • 0.0.4 - Samplify thr method to create logger and provide the default logger that can be used directly.
  • 0.0.3post1 - Fix the bug.
  • 0.0.3 - Add the level definition.
  • 0.0.2post2 - Fix the bug.
  • 0.0.2post1 - Fix the bug.
  • 0.0.2 - Add the summery and throughput method.
  • 0.0.1 - We provide the common config for logging to create logger.

License

Sample Loggers is MIT licensed. See the LICENSE for details.

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

sample_loggers-0.0.4.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

sample_loggers-0.0.4-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file sample_loggers-0.0.4.tar.gz.

File metadata

  • Download URL: sample_loggers-0.0.4.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for sample_loggers-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e7a9a7ef0ad58a63fff71d7f0341f7308ff3ce64c1f6316312dd9e945e066d66
MD5 70370cbc02ac02cad537f338d9498b8f
BLAKE2b-256 c16e9aba5775ae9de7f4f8fe6368350bfe48963b0a42d3d0b9a4d5d5bfba4505

See more details on using hashes here.

File details

Details for the file sample_loggers-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: sample_loggers-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for sample_loggers-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c2332485581e9810cdf6d8ebbea5fd5010cea402f591e31531bb8936461e8aeb
MD5 e24aa96fbe14b15ebea1aad14af58c2a
BLAKE2b-256 097bf738c55b140522c5965a639a225822ca772ae9738bda7848ef93737374bd

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