[IPython-dev] iplogging here we go again xD

Omar Andrés Zapata Mesa andresete.chaos@gmail....
Wed Dec 29 17:45:11 CST 2010


Hi all,
I write again the module for logging restructure.

example1:

import iplogging
import logging
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(logging.Formatter("%(levelname)s\n%(filename)s\n%(lineno)s\n%(message)s"))
iplogger = iplogging.IpLogger(colors=True, ipmode=True)
iplogger.addHandler(stream_handler)
iplogger.info("info message")
iplogger.debug("debug message")

colors optional, default False
ipmode show labels like MESSAGE:"your message here"
ipmode default False too.


example2:

import iplogging
import logging
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(logging.Formatter("%(levelname)s\n%(filename)s\n%(lineno)s\n%(message)s"))
iplogger = iplogging.IpLogger()
iplogger.addHandler(stream_handler)
iplogger.info("info message")
iplogger.debug("debug message")

without colors or ipmode is the same that to use logging



-- 
Omar Andres Zapata Mesa
Head Developer Phenomenology of Fundamental Interactions Group (Gfif)
http://gfif.udea.edu.co
Division of computer science Gfif Developers (Gfif Dev)
http://gfifdev.udea.edu.co
Systems Engineering Student
Universidad de Antioquia At Medellin - Colombia
Usuario Linux  #490962
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20101229/d47ff281/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IpythonLogging1.png
Type: image/png
Size: 29646 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/ipython-dev/attachments/20101229/d47ff281/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IpythonLogging2.png
Type: image/png
Size: 25692 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/ipython-dev/attachments/20101229/d47ff281/attachment-0003.png 


More information about the IPython-dev mailing list