Skip to main content

The new python logger

Project description

pylog pypi-aka:pythonlog

The new python logger

Install

pip install pythonlog

How to use

log

generates a log message

example:
    script:
        import pylog
        pylog.log("system.log","this is a log")
    output:
        [LOG] [0000-00-00 00:00:00.000000] this is a log
Args:
    location ([str]): [Defines the location of the log file]
    msg ([str]): [Message to log]
    log_time (bool, optional): [Defines wether the time of the log is added onto the log]. Defaults to True.
    file (bool, optional): [Defines wether a file name should be logged you need to define the file ]. Defaults to False.

debug

generates a debug log

example:
    script:
        import pylog
        pylog.debug("system.log","this is a log")
    output:
        [DEBUG] [0000-00-00 00:00:00.000000] this is a log
Args:
    location ([str]): [Defines the location of the log file]
    msg ([str]): [Message to log]
    log_time (bool, optional): [Defines wether the time of the log is added onto the log]. Defaults to True.
    file (bool, optional): [Defines wether a file name should be logged you need to define the file ]. Defaults to False.

warn

generates a warn log

example:
    script:
        import pylog
        pylog.warn("system.log","this is a log")
    output:
        [WARNING] [0000-00-00 00:00:00.000000] this is a log
Args:
    location ([str]): [Defines the location of the log file]
    msg ([str]): [Message to log]
    log_time (bool, optional): [Defines wether the time of the log is added onto the log]. Defaults to True.
    file (bool, optional): [Defines wether a file name should be logged you need to define the file ]. Defaults to False.

error

generates a error log

example:
    script:
        import pylog
        pylog.error("system.log","this is a log")
    output:
        [ERROR] [0000-00-00 00:00:00.000000] this is a log
Args:
    location ([str]): [Defines the location of the log file]
    msg ([str]): [Message to log]
    log_time (bool, optional): [Defines wether the time of the log is added onto the log]. Defaults to True.
    file (bool, optional): [Defines wether a file name should be logged you need to define the file ]. Defaults to False.

critical error

generates a critical error log

example:
    script:
        import pylog
        pylog.cerror("system.log","this is a log")
    output:
        [CRITICAL_ERROR] [0000-00-00 00:00:00.000000] this is a log
Args:
    location ([str]): [Defines the location of the log file]
    msg ([str]): [Message to log]
    log_time (bool, optional): [Defines wether the time of the log is added onto the log]. Defaults to True.
    file (bool, optional): [Defines wether a file name should be logged you need to define the file ]. Defaults to False.

fatal error

generates a critical error log

example:
    script:
        import pylog
        pylog.ferror("system.log","this is a log")
    output:
        [FATAL_ERROR] [0000-00-00 00:00:00.000000] this is a log
Args:
    location ([str]): [Defines the location of the log file]
    msg ([str]): [Message to log]
    log_time (bool, optional): [Defines wether the time of the log is added onto the log]. Defaults to True.
    file (bool, optional): [Defines wether a file name should be logged you need to define the file ]. Defaults to False.

messsage

writes a message in a log file

example:
    script:
        import pylog
        pylog.message("system.log","this is a log")
    output:
        this is a message
Args:
    location ([str]): [Defines the location of the log file]
    msg ([str]): [Message to log]

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

pythonlog-0.1.3.tar.gz (14.9 kB view hashes)

Uploaded Source

Built Distribution

pythonlog-0.1.3-py3-none-any.whl (15.1 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