Skip to content

Commit

Permalink
ConsolePrinter: Use ColoredLogPrinter
Browse files Browse the repository at this point in the history
This makes all log messages colored automatically.
  • Loading branch information
sils committed May 2, 2015
1 parent e295e38 commit 333abb2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions coalib/output/printers/ConsolePrinter.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
from coalib.output.printers.ColorPrinter import ColorPrinter
from coalib.output.printers.LogPrinter import LogPrinter
from coalib.output.printers.ColoredLogPrinter import ColoredLogPrinter
from coalib.output.printers.LOG_LEVEL import LOG_LEVEL


class ConsolePrinter(LogPrinter, ColorPrinter):
class ConsolePrinter(ColoredLogPrinter):
"""
A simple printer for the console that supports colors and logs.
Note that pickling will not pickle the output member.
"""
def __init__(self, log_level=LOG_LEVEL.WARNING, timestamp_format="%X"):
ColorPrinter.__init__(self)
LogPrinter.__init__(self,
log_level=log_level,
timestamp_format=timestamp_format)
ColoredLogPrinter.__init__(self,
log_level=log_level,
timestamp_format=timestamp_format)

def _print_uncolored(self, output, **kwargs):
print(output, end="")
Expand Down

1 comment on commit 333abb2

@Makman2
Copy link
Member

@Makman2 Makman2 commented on 333abb2 May 2, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

Please sign in to comment.