bootstrap/p1.5.0/src/common/mapr_logger/log.py
def _log(level, msg, args, exc_info=None, extra=None):
        if msg is None:
            return
        msg = str(msg).strip(' \n')

        if exc_info:
            if not isinstance(exc_info, tuple):
                exc_info = sys.exc_info()

        if Log._file_logger is None and Log._console_logger is None:
            if exc_info:
                sio = StringIO()
                traceback.print_exception(exc_info[0], exc_info[1], exc_info[2], file=sio)
                s = sio.getvalue()
                sio.close()
                if s[-1:] == "\n":
                    s = s[:-1]
                print(Log.NOT_INITIALIZED % (logging.getLevelName(level), s))
            else:
                print(Log.NOT_INITIALIZED % (logging.getLevelName(level), msg))

        """Log the message to the logger(s)"""
        fn, lno, func = Log._find_caller()

        if Log._file_logger is not None:
            record = Log._file_logger.makeRecord(Log._file_logger.name, level,
                                                 fn, lno, msg, args, exc_info,
                                                 func, extra)
            Log._file_logger.handle(record)
Log the message to the logger(s)
Log the message to the logger(s)
Log the message to the logger ( s )
def _log(level, msg, args, exc_info=None, extra=None):
        if msg is None:
            return
        msg = str(msg).strip(' \n')
        if exc_info:
            if not isinstance(exc_info, tuple):
                exc_info = sys.exc_info()
        if Log._file_logger is None and Log._console_logger is None:
            if exc_info:
                sio = StringIO()
                traceback.print_exception(exc_info[0], exc_info[1], exc_info[2], file=sio)
                s = sio.getvalue()
                sio.close()
                if s[-1:] == "\n":
                    s = s[:-1]
                print(Log.NOT_INITIALIZED % (logging.getLevelName(level), s))
            else:
                print(Log.NOT_INITIALIZED % (logging.getLevelName(level), msg))
        fn, lno, func = Log._find_caller()
        if Log._file_logger is not None:
            record = Log._file_logger.makeRecord(Log._file_logger.name, level,
                                                 fn, lno, msg, args, exc_info,
                                                 func, extra)
            Log._file_logger.handle(record)
def _log ( level , msg , args , exc_info = None , extra = None ) : if msg is None : return msg = str ( msg ) . strip ( ' \n' ) if exc_info : if not isinstance ( exc_info , tuple ) : exc_info = sys . exc_info ( ) if Log . _file_logger is None and Log . _console_logger is None : if exc_info : sio = StringIO ( ) traceback . print_exception ( exc_info [ 0 ] , exc_info [ 1 ] , exc_info [ 2 ] , file = sio ) s = sio . getvalue ( ) sio . close ( ) if s [ - 1 : ] == "\n" : s = s [ : - 1 ] print ( Log . NOT_INITIALIZED % ( logging . getLevelName ( level ) , s ) ) else : print ( Log . NOT_INITIALIZED % ( logging . getLevelName ( level ) , msg ) ) fn , lno , func = Log . _find_caller ( ) if Log . _file_logger is not None : record = Log . _file_logger . makeRecord ( Log . _file_logger . name , level , fn , lno , msg , args , exc_info , func , extra ) Log . _file_logger . handle ( record )
Log the message to the logger(s)
Log the message to the logger ( s )
"""Log the message to the logger(s)"""
level
msg
args
exc_info
extra