Пример #1
0
 def logerror(self, formatstr, values=[]):
     """Use this method to log error messages. The log messages will
     be formated and handled based on the configuration settings from
     ``[pluggdapps]`` section.
     """
     output, erlport = self.logsett["output"], self.erlport
     formatstr = "ERROR: " + formatstr
     if "cloud" in output and erlport:
         self.erlport.logerror(formatstr, values)
     if "file" in output and self.logsett["file"]:
         open(self.logsett["file"], "a").write(formatstr)
     if "console" in output:
         print(h.colorize(formatstr, color="31"))
Пример #2
0
 def logerror(self, formatstr, values=[]):
     """Use this method to log error messages. The log messages will
     be formated and handled based on the configuration settings from
     ``[pluggdapps]`` section.
     """
     output, erlport = self.logsett['output'], self.erlport
     formatstr = 'ERROR: ' + formatstr
     if 'cloud' in output and erlport:
         self.erlport.logerror(formatstr, values)
     if 'file' in output and self.logsett['file']:
         open(self.logsett['file'], 'a').write(formatstr)
     if 'console' in output:
         print(h.colorize(formatstr, color='31'))
Пример #3
0
    def logdebug(self, formatstr, values=[]):
        """Use this method to log debug messages. The log messages will
        be formated and handled based on the configuration settings from
        ``[pluggdapps]`` section.
        """
        if self.settings['DEFAULT']['debug'] != True: return

        output, erlport = self.logsett['output'], self.erlport
        formatstr = 'DEBUG: ' + formatstr
        if 'cloud' in output and erlport:
            self.erlport.logdebug(formatstr, values)
        if 'file' in output and self.logsett['file']:
            open(self.logsett['file'], 'a').write(formatstr)
        if 'console' in output:
            print(h.colorize(formatstr, color='33'))
Пример #4
0
    def logdebug(self, formatstr, values=[]):
        """Use this method to log debug messages. The log messages will
        be formated and handled based on the configuration settings from
        ``[pluggdapps]`` section.
        """
        if self.settings["DEFAULT"]["debug"] != True:
            return

        output, erlport = self.logsett["output"], self.erlport
        formatstr = "DEBUG: " + formatstr
        if "cloud" in output and erlport:
            self.erlport.logdebug(formatstr, values)
        if "file" in output and self.logsett["file"]:
            open(self.logsett["file"], "a").write(formatstr)
        if "console" in output:
            print(h.colorize(formatstr, color="33"))