sregistry/logger/message.py
def emit(self, level, message, prefix=None, color=None):
        '''emit is the main function to print the message
        optionally with a prefix
        :param level: the level of the message
        :param message: the message to print
        :param prefix: a prefix for the message
        '''
        if color is None:
            color = level

        if prefix is not None:
            prefix = self.addColor(color, "%s " % (prefix))
        else:
            prefix = ""
            message = self.addColor(color, message)

        # Add the prefix
        message = "%s%s" % (prefix, message)

        if not message.endswith('\n'):
            message = "%s\n" % message

        # If the level is quiet, only print to error
        if self.level == QUIET:
            pass

        # Otherwise if in range print to stdout and stderr
        elif self.isEnabledFor(level):
            if self.emitError(level):
                self.write(self.errorStream, message)
            else:
                self.write(self.outputStream, message)

        # Add all log messages to history
        self.history.append(message)
def emit(self, level, message, prefix=None, color=None):
        '''emit is the main function to print the message
        optionally with a prefix
        :param level: the level of the message
        :param message: the message to print
        :param prefix: a prefix for the message
        '''
        if color is None:
            color = level

        if prefix is not None:
            prefix = self.addColor(color, "%s " % (prefix))
        else:
            prefix = ""
            message = self.addColor(color, message)

        # Add the prefix
        message = "%s%s" % (prefix, message)

        if not message.endswith('\n'):
            message = "%s\n" % message

        # If the level is quiet, only print to error
        if self.level == QUIET:
            pass

        # Otherwise if in range print to stdout and stderr
        elif self.isEnabledFor(level):
            if self.emitError(level):
                self.write(self.errorStream, message)
            else:
                self.write(self.outputStream, message)

        # Add all log messages to history
        self.history.append(message)
def emit ( self , level , message , prefix = None , color = None ) : if color is None : color = level if prefix is not None : prefix = self . addColor ( color , "%s " % ( prefix ) ) else : prefix = "" message = self . addColor ( color , message ) # Add the prefix message = "%s%s" % ( prefix , message ) if not message . endswith ( '\n' ) : message = "%s\n" % message # If the level is quiet, only print to error if self . level == QUIET : pass # Otherwise if in range print to stdout and stderr elif self . isEnabledFor ( level ) : if self . emitError ( level ) : self . write ( self . errorStream , message ) else : self . write ( self . outputStream , message ) # Add all log messages to history self . history . append ( message )
emit is the main function to print the message
        optionally with a prefix
        :param level: the level of the message
        :param message: the message to print
        :param prefix: a prefix for the message
emit is the main function to print the message optionally with a prefix : param level : the level of the message : param message : the message to print : param prefix : a prefix for the message