Beispiel #1
0
 def log(self, e):
     if self.options.verbosity >= utils.log_tier(e.level):
         click.secho(e.msg,
                     file=self.options.tfile,
                     fg=dict(error="red", warn="yellow").get(e.level),
                     dim=(e.level == "debug"),
                     err=(e.level == "error"))
Beispiel #2
0
 def add_log(self, e, level="info"):
     if level == "error":
         self.has_errored = True
     if self.options.verbosity >= utils.log_tier(level):
         click.secho(e,
                     file=self.options.tfile,
                     fg=dict(error="red", warn="yellow").get(level),
                     dim=(level == "debug"),
                     err=(level == "error"))
Beispiel #3
0
 def add_log(self, e, level="info"):
     if level == "error":
         self.has_errored = True
     if self.options.verbosity >= utils.log_tier(level):
         click.secho(e,
                     file=self.options.tfile,
                     fg="red" if level == "error" else None,
                     dim=(level == "debug"),
                     err=(level == "error"))
Beispiel #4
0
 def add_log(self, e, level="info"):
     if level == "error":
         self.has_errored = True
     if self.options.verbosity >= utils.log_tier(level):
         self.echo(
             e,
             fg="red" if level == "error" else None,
             dim=(level == "debug"),
             err=(level == "error")
         )
Beispiel #5
0
 def add_log(self, e, level="info"):
     if level == "error":
         self.has_errored = True
     if self.options.verbosity >= utils.log_tier(level):
         click.secho(
             e,
             file=self.options.tfile,
             fg=dict(error="red", warn="yellow").get(level),
             dim=(level == "debug"),
             err=(level == "error"),
         )
Beispiel #6
0
    def sig_add_log(self, sender, e, level):
        if self.options.verbosity < utils.log_tier(level):
            return

        if level in ("error", "warn"):
            signals.status_message.send(
                message="{}: {}".format(level.title(), e))
            e = urwid.Text((level, str(e)))
        else:
            e = urwid.Text(str(e))
        self.logbuffer.append(e)
        if len(self.logbuffer) > EVENTLOG_SIZE:
            self.logbuffer.pop(0)
        self.logbuffer.set_focus(len(self.logbuffer) - 1)
Beispiel #7
0
    def sig_add_log(self, sender, e, level):
        if self.options.verbosity < utils.log_tier(level):
            return

        if level == "error":
            signals.status_message.send(
                message = "Error: %s" % str(e)
            )
            e = urwid.Text(("error", str(e)))
        else:
            e = urwid.Text(str(e))
        self.logbuffer.append(e)
        if len(self.logbuffer) > EVENTLOG_SIZE:
            self.logbuffer.pop(0)
        self.logbuffer.set_focus(len(self.logbuffer) - 1)
Beispiel #8
0
    def sig_add_log(self, sender, e, level):
        if self.options.verbosity < utils.log_tier(level):
            return

        if level in ("error", "warn"):
            signals.status_message.send(
                message = "{}: {}".format(level.title(), e)
            )
            e = urwid.Text((level, str(e)))
        else:
            e = urwid.Text(str(e))
        self.logbuffer.append(e)
        if len(self.logbuffer) > EVENTLOG_SIZE:
            self.logbuffer.pop(0)
        self.logbuffer.set_focus(len(self.logbuffer) - 1)