Skip to main content

Another collection of utilities

Project description

logging

logging consists of the following classes and functions to help with the burden of logging

RelativePathRotatingFileHandler

Not sure if this is working properly

get_logger()

This function retrieves a logger for your file and function/method. This should be called first. For example:

logger = get_logger()
logger.debug("Hello world")

start_function(logger, **kwargs)

This function tags the log file with the entry of a function/method. You may turn it on or off in your logging configuration

def my_function()
    logger = get_logger()
    start_function("You may optionally add information in the kwarks here")

end_function(logger, **kwargs)

This function tags the log file with the exit of a function/method. You may turn it on or off in your logging configuration

def my_function()
    logger = get_logger()
    a = 1 + 2    
    end_function("the value of a is {}".format(a))

os

os consists of the following classes and functions

UnhandledOs

This is raised when the library does not recognize the operating system

list_timezones()

This function returns all known timezones

get_timezone()

This function returns the timezone selected by the operating system

kill_process(name)

This function kills the specified process name

is_running(name)

This function returns whether the specified process name is currently running

os_type()

This function returns the operating system type

get_ip_addresses()

This function returns all IP addresses on this hardware

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thompcoutils-0.0.18.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

thompcoutils-0.0.18-py3-none-any.whl (4.7 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