Skip to content

Commit 31f6ba9

Browse files
authored
Merge pull request #25 from JingleheimerSE/add-time-format-specifier
Add format specifier for time value to keep alignment consistant
2 parents 35bce69 + 0551bb2 commit 31f6ba9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_logging/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ def format(self, log_level: int, message: str) -> str:
111111
:param str message: the message to log
112112
113113
"""
114-
return "{0}: {1} - {2}".format(time.monotonic(), level_for(log_level), message)
114+
return "{0:<0.3f}: {1} - {2}".format(
115+
time.monotonic(), level_for(log_level), message
116+
)
115117

116118
def emit(self, log_level: int, message: str):
117119
"""Send a message where it should go.

0 commit comments

Comments
 (0)