1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 20:19:46 +00:00

emph gets logged to stdout for #331

This commit is contained in:
deadc0de6
2021-10-19 22:18:11 +02:00
parent 16ecd7a1d4
commit f9c318679a

View File

@@ -44,11 +44,15 @@ class Logger:
cend = self._color(self.RESET)
sys.stdout.write('\t{}->{} {}{}'.format(cstart, cend, string, end))
def emph(self, string):
def emph(self, string, stdout=True):
"""emphasis log"""
cstart = self._color(self.EMPH)
cend = self._color(self.RESET)
sys.stderr.write('{}{}{}'.format(cstart, string, cend))
content = '{}{}{}'.format(cstart, string, cend)
if not stdout:
sys.stderr.write(content)
else:
sys.stdout.write(content)
def err(self, string, end='\n'):
"""error log"""