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.4post1 - Fix the bug.
  • 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.post1.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.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sample_loggers-0.0.4.post1.tar.gz
  • Upload date:
  • Size: 4.4 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.post1.tar.gz
Algorithm Hash digest
SHA256 3550ed4ba702efb682280199d9d7e15d8c48eeda817bb9c1fdbfc8eb1985a03e
MD5 879b33ce12475c84c686de52756905df
BLAKE2b-256 3e7ae2e343cad407a4c8b13671233b92d43fcfbab91c3545776bd050f562d713

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sample_loggers-0.0.4.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9d49dc15bdb4028008a254bcde57dad52f0bf7e67c0003dd6a499626e294985
MD5 428494647e4ebb269f0bf239316290d0
BLAKE2b-256 08f4c0dc4c7b8a05c45722d6424144692ad666419aed9ec358e3eba760450030

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