Skip to content

Commit

Permalink
Add microseconds displaying debug events
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Jul 16, 2021
1 parent aa274c5 commit a51ef6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mdpo/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def debug_events(program): # pragma: no cover
dict: Event target printing functions.
"""
def debug(event, msg):
date = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
date = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
sys.stdout.write(f'{program}[DEBUG]::{date}::{event}:: {msg}\n')

def print_msgid(self, msgid, msgstr, msgctxt, tcomment, flags):
Expand Down
2 changes: 1 addition & 1 deletion test/test_md2po/test_md2po_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def test_debug(capsys, arg):
for i, line in enumerate(outlines):
assert re.match(
(
r'^md2po\[DEBUG\]::\d{4,}-\d\d-\d\d\s\d\d:\d\d:\d\d::'
r'^md2po\[DEBUG\]::\d{4,}-\d\d-\d\d\s\d\d:\d\d:\d\d\.\d+::'
r'(text|link_reference|msgid|command|enter_block|'
r'leave_block|enter_span|leave_span)::'
),
Expand Down
2 changes: 1 addition & 1 deletion test/test_po2md/test_po2md_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_debug(capsys, arg, tmp_file):
for i, line in enumerate(outlines):
assert re.match(
(
r'^po2md\[DEBUG\]::\d{4,}-\d\d-\d\d\s\d\d:\d\d:\d\d::'
r'^po2md\[DEBUG\]::\d{4,}-\d\d-\d\d\s\d\d:\d\d:\d\d\.\d+::'
r'(text|link_reference|msgid|enter_block|command|'
r'leave_block|enter_span|leave_span)::'
),
Expand Down

0 comments on commit a51ef6f

Please sign in to comment.