Simple interface for logging in python
Project description
Simplelog Class Methods:
========================
Simplelog()
Creates a logger that prints the log files in the current directory.
quiet()
Stops the logger from printing to standard out
enable()
Restarts the logger with original path.
SL
Singleton instance of the simplelog. The log files are stored in /tmp/simplelog.log. Default behavior is to rewrite the log everytime
Decorators:
-----------
enable()
If simplelog is disabled, enables it for function. Otherwise,
does nothing.
disable()
If simplelog is enabled, disable it for function. Otherwise does
nothing.
dump_func(level = None, func_name_only = False, pretty = True)
Usage:
=========
import simplelog
SL = simplelog.SL
def foo(bar):
...
x = acc
SL.debug("value of x: " %s str(x))
# Disabling and Enabling the simplelogger
def bar(foo):
SL.disable()
SL.debug("old debug message")
SL.debug("more debug messsages")
SL.enable()
========================
Simplelog()
Creates a logger that prints the log files in the current directory.
quiet()
Stops the logger from printing to standard out
enable()
Restarts the logger with original path.
SL
Singleton instance of the simplelog. The log files are stored in /tmp/simplelog.log. Default behavior is to rewrite the log everytime
Decorators:
-----------
enable()
If simplelog is disabled, enables it for function. Otherwise,
does nothing.
disable()
If simplelog is enabled, disable it for function. Otherwise does
nothing.
dump_func(level = None, func_name_only = False, pretty = True)
Usage:
=========
import simplelog
SL = simplelog.SL
def foo(bar):
...
x = acc
SL.debug("value of x: " %s str(x))
# Disabling and Enabling the simplelogger
def bar(foo):
SL.disable()
SL.debug("old debug message")
SL.debug("more debug messsages")
SL.enable()
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
simplelog-0.2.tar.gz
(3.6 kB
view hashes)