Design Pattern Examples
Overview of object-oriented design patterns
bridge_loggerhelpers.py
Go to the documentation of this file.
5
6from datetime import datetime
7
8
10
14 def _GetTimeStamp() -> str:
15 current_timestamp = datetime.now()
16 return current_timestamp.strftime("%m/%d/%Y %I:%M:%S %p")
17
18
19
27 def FormatLogLine(logLevel : str, msg : str) -> str:
28 timestamp = LoggerHelpers._GetTimeStamp()
29 return "{} [{}] {}".format(timestamp, logLevel, msg)
str _GetTimeStamp()
Return a regular time stamp of the current time in local time.
str FormatLogLine(str logLevel, str msg)
Format a line for logging, including time stamp.