Logistro wraps logging for added defaults and subprocess logging.
Typical usage:
-
import logistro
-logger = logistro.getLogger(name)
-logger.debug2("This will be printed more informatively")
-
Advanced
-
pipe, logger = logistro.getPipeLogger(name)
-
Pipe all stderr to our logger
-
subprocess.Popen(process_name, stderr=pipe)
-
subprocess.wait()
-os.close(pipe)
-
Attributes
+
importlogistro
+logger=logistro.getLogger(__name__)
+logger.debug2("This will be printed more informatively")
+
+# Advanced
+pipe,logger=logistro.getPipeLogger(__name__)
+# Pipe all stderr to our logger
+subprocess.Popen(process_name,stderr=pipe)
+
+# Eventually close the pipe in case other process doesn't
+subprocess.wait()
+os.close(pipe)
+
+
Globals
DEBUG2 - A more verbose version of logging.DEBUG
-
human_formatter -
-
structured_formatter -
+
human_formatter - A logging.Formatter() to print output nicely.
+
structured_formatter - A logging.Formatter() to print output as JSON for machine consumption.