Skip to content

A simple way to manage the verbose of a python program

License

Notifications You must be signed in to change notification settings

tomMoulard/verbose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Verbose

This is a simple way to manage the output for debug a python script. And add some simple but effective results.

Verbosity level

You can choose the verbosity level outputed on stdout when you initiate the class:

v = verbose.Verbose(outputfile="README.md", level=10)

Time

There is also a simple time capturing device:

import time
v.timeOn("test")
time.sleep(1)
t = v.timeOff("test")

Now t is roughtly 1s

More output

You can also use some arguments in the function:

v.v("The result is {}", 9, kwargs = (t,))

The output file

You have the choice to save (or not) the output of your script. By default, this will not save it, but you can call "saveOutput"

v.saveOutput()

This file was generated with this script (see this file for the code)