Esempio n. 1
0
            filename = os.path.normcase(co.co_filename)
            if "logger" in filename:  # This line is modified.
                f = f.f_back
                continue
            filename = filename + " " + co.co_name
            rv = (filename, f.f_lineno, co.co_name)
            break
        return rv


logging.setLoggerClass(ExtendedLogger)
logging.basicConfig(
    level=logging.DEBUG,
    format='%(levelname)-5s %(asctime)s [%(filename)-40s] %(message)s',
    datefmt="%d/%m/%y-%H:%M:%S",
    filename=os.path.join(config.get_data_path(), "pelisalacarta.log"),
    filemode='w')
logger_object = logging.getLogger("mediaserver")


def info(texto=""):
    if config.get_setting("debug") == True:
        logger_object.info(
            unicode(str(texto), "utf-8",
                    "ignore").replace("\n", "\n" + " " * 67))


def debug(texto=""):
    if config.get_setting("debug") == True:
        logger_object.debug(
            unicode(str(texto), "utf-8",
Esempio n. 2
0
        while hasattr(f, "f_code"):
            co = f.f_code
            filename = os.path.normcase(co.co_filename)
            if "logger" in filename: # This line is modified.
                f = f.f_back
                continue
            filename =filename + " " + co.co_name
            rv = (filename , f.f_lineno, co.co_name)
            break
        return rv
        
logging.setLoggerClass(ExtendedLogger)        
logging.basicConfig(level=logging.DEBUG,
format='%(levelname)-5s %(asctime)s [%(filename)-40s] %(message)s',
datefmt="%d/%m/%y-%H:%M:%S",
filename=os.path.join(config.get_data_path(),"pelisalacarta.log"),
filemode='w')
logger_object=logging.getLogger("mediaserver")


def info(texto):
  if int(config.get_setting("debuglevel"))>2:
      logger_object.info(unicode(str(texto),"utf-8","ignore").replace("\n","\n"+ " "*67))

def debug(texto):
  if int(config.get_setting("debuglevel"))>1:
      logger_object.debug(unicode(str(texto),"utf-8","ignore").replace("\n","\n"+ " "*67))

def error(texto):
  if int(config.get_setting("debuglevel"))>0:
    logger_object.error(unicode(str(texto),"utf-8","ignore").replace("\n","\n"+ " "*67))
Esempio n. 3
0
            filename = os.path.normcase(co.co_filename)
            if "logger" in filename:  # This line is modified.
                f = f.f_back
                continue
            filename = filename + " " + co.co_name
            rv = (filename, f.f_lineno, co.co_name)
            break
        return rv


logging.setLoggerClass(ExtendedLogger)
logging.basicConfig(
    level=logging.DEBUG,
    format='%(levelname)-5s %(asctime)s [%(filename)-40s] %(message)s',
    datefmt="%d/%m/%y-%H:%M:%S",
    filename=os.path.join(config.get_data_path(), "kod.log"),
    filemode='w')
logger_object = logging.getLogger("mediaserver")


def info(texto=""):
    print texto
    #if config.get_setting("debug"):
    #    logger_object.info(unicode(str(texto), "utf-8", "ignore").replace("\n", "\n" + " " * 67))


def debug(texto=""):
    print texto
    #if config.get_setting("debug"):
    #    logger_object.debug(unicode(str(texto), "utf-8", "ignore").replace("\n", "\n" + " " * 67))