Skip to main content

A Simple logging Liblary.

Project description

nlogging

Description

nlogging is a Python package for a Simple logging Liblary.

Installaction

pip install nlogging

Usage

from nlogging import nLogging
from nlogging import DEBUG, INFO, WARNING, ERROR, CRITICAL, NOOUT


def subfunc1():
	logging.output(DEBUG, 'message for debugging.')
	logging.output(CRITICAL, 'message for critical!')

def subfunc2():
	logging.output(DEBUG, 'message for debugging.')
	logging.output(CRITICAL, 'message for critical!')


# Initializing for nLogging
logging = nLogging('YourLoggerName', './sample.log')
logging.set_out_level(stream_lv=DEBUG, file_lv=DEBUG)

logging.output(DEBUG, 'message for debugging.')
logging.output(CRITICAL, 'message for critical!')


# You can chang log-lv(stream_lv: DEBUG -> INFO, file_lv: DEBUG -> INFO)
logging.set_out_level(stream_lv=INFO, file_lv=INFO)
subfunc1()

# You can chang log-lv(stream_lv: INFO -> NOOUT, file_lv: INFO -> WARNING)
logging.set_out_level(stream_lv=NOOUT, file_lv=WARNING)
subfunc2()

Result(stream)

2024/03/17 18:18:29.602 DEBUG    exsample.py(18) [<module>] message for debugging.
2024/03/17 18:18:29.602 CRITICAL exsample.py(19) [<module>] message for critical!
2024/03/17 18:18:29.602 CRITICAL exsample.py(7) [subfunc1] message for critical!

Result(file)

2024/03/17 18:18:29.602 DEBUG    exsample.py(18) [<module>] message for debugging.
2024/03/17 18:18:29.602 CRITICAL exsample.py(19) [<module>] message for critical!
2024/03/17 18:18:29.602 CRITICAL exsample.py(7) [subfunc1] message for critical!
2024/03/17 18:18:29.602 CRITICAL exsample.py(11) [subfunc2] message for critical!

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

nlogging-0.1.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

nlogging-0.1.0-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

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