import sys

class Debug(object):
    def __init__(self, level=3):
        self.level = level
        self._pv = {
            'log': 3,
            'debug': 2,
            'error': 1,
        }

    def log(self, msg='', *args, **kwargs):
        self._pr(sys._getframe().f_code.co_name, msg, *args)

    def debug(self, msg='', *args, **kwargs):
        self._pr(sys._getframe().f_code.co_name, msg, *args)

    def error(self, msg='', *args, **kwargs):
        self._pr(sys._getframe().f_code.co_name, msg, *args)

    def _pr(self, func, msg, *args):
        if self.level >= self._pv[func]:
            print '[{0}] {1} {2}'.format(func.upper(), repr(msg), ' '.join(map(repr, args)))



@@ -5,16 +5,385 @@
 rt sys%0A%0A
+%0A%22%22%22%0A    @Usage:%0A        import Debug as D%0A        d = D(level=4, color=True)%0A        d.info('Some info', my_vars)%0A        d.log('This is Log')%0A        d.debug('For debugging')%0A        d.error('Fatal Errors', error_objects)%0A%0A    @param:%0A        level: integer.%0A        color: boolean.%0A%0A    @def:%0A        info(..)%0A        log(..)%0A        debug(..)%0A        error(..)%0A%22%22%22%0A
 class De
@@ -428,12 +428,52 @@
 vel=
-3
+4, color=False
 ):%0A
+        self.color = color%0A
     
@@ -533,74 +533,540 @@
    '
-log': 3,%0A            'debug': 2,%0A            'error': 1,%0A        %7D
+info': %7B%0A                'level': 4,%0A                'color': ByColors.OKGREEN,%0A            %7D,%0A            'log': %7B%0A                'level': 3,%0A                'color': ByColors.HEADER,%0A            %7D,%0A            'debug': %7B%0A                'level': 2,%0A                'color': ByColors.WARNING,%0A            %7D,%0A            'error': %7B%0A                'level': 1,%0A                'color': ByColors.FAIL,%0A            %7D,%0A        %7D%0A%0A    def info(self, msg='', *args, **kwargs):%0A        self._pr(sys._getframe().f_code.co_name, msg, *args)
 %0A%0A  
@@ -1461,18 +1461,195 @@
 pv%5Bfunc%5D
+%5B'level'%5D
 :%0A
+            if self.color:%0A                func_txt = self._pv%5Bfunc%5D%5B'color'%5D + func.upper() + ByColors.ENDC%0A            else:%0A                func_txt = func.upper()%0A%0A
         
@@ -1685,24 +1685,20 @@
 mat(func
-.upper()
+_txt
 , repr(m
@@ -1731,8 +1731,167 @@
 gs)))%0A%0A%0A
+class ByColors:%0A    HEADER = '%5C033%5B95m'%0A    OKBLUE = '%5C033%5B94m'%0A    OKGREEN = '%5C033%5B92m'%0A    WARNING = '%5C033%5B93m'%0A    FAIL = '%5C033%5B91m'%0A    ENDC = '%5C033%5B0m'%0A%0A%0A

update debug code and comments.