tasklogger
Project description
An extension to the core python logging library for logging the beginning and completion of tasks and subtasks.
Installation
tasklogger is available on pip. Install by running the following in a terminal:
pip install --user tasklogger
Usage example
Use tasklogger for all your logging needs - receive timed updates mid-computation using tasklogger.log_start and tasklogger.log_complete:
>>> import tasklogger >>> import time >>> tasklogger.log_start("Supertask") Calculating Supertask... >>> time.sleep(1) >>> tasklogger.log_start("Subtask") Calculating Subtask... >>> time.sleep(1) >>> tasklogger.log_complete("Subtask") Calculated Subtask in 1.01 seconds. >>> time.sleep(1) >>> tasklogger.log_complete("Supertask") Calculated Supertask in 3.02 seconds. >>> tasklogger.log_info("Log some stuff that doesn't need timing") Log some stuff that doesn't need timing >>> tasklogger.log_debug("Log some stuff that normally isn't needed") >>> tasklogger.set_level(2) Set TaskLogger logging to DEBUG >>> tasklogger.log_debug("Log some stuff that normally isn't needed") Log some stuff that normally isn't needed
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
tasklogger-0.3.0.tar.gz
(13.1 kB
view hashes)