Ejemplo n.º 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"))
Ejemplo n.º 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"))
Ejemplo n.º 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"))
Ejemplo n.º 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")
         )
Ejemplo n.º 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"),
         )
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)