Improved docstrings
This commit is contained in:
@@ -13,6 +13,11 @@ with open(getcwd()+path.sep+"config.json", "r", encoding='utf8') as file:
|
||||
|
||||
# Check latest log size
|
||||
def checkSize(debug=False):
|
||||
"""Check size of latest.log file and rotate it if needed
|
||||
|
||||
### Args:
|
||||
* debug (`bool`, *optional*): Whether this is a debug log. Defaults to `False`.
|
||||
"""
|
||||
|
||||
global log_folder
|
||||
|
||||
@@ -35,7 +40,13 @@ def checkSize(debug=False):
|
||||
pass
|
||||
|
||||
# Append string to log
|
||||
def logAppend(message, debug=False):
|
||||
def logAppend(message: str, debug=False):
|
||||
"""Write message to log file
|
||||
|
||||
### Args:
|
||||
* message (`str`): Message to write
|
||||
* debug (`bool`, *optional*): Whether this is a debug log. Defaults to `False`.
|
||||
"""
|
||||
|
||||
global log_folder
|
||||
|
||||
@@ -52,7 +63,13 @@ def logAppend(message, debug=False):
|
||||
log.close()
|
||||
|
||||
# Print to stdout and then to log
|
||||
def logWrite(message, debug=False):
|
||||
def logWrite(message: str, debug=False):
|
||||
"""Write message to stdout and log file
|
||||
|
||||
### Args:
|
||||
* message (`str`): Message to print and write
|
||||
* debug (`bool`, *optional*): Whether this is a debug log. Defaults to `False`.
|
||||
"""
|
||||
# save to log file and rotation is to be done
|
||||
logAppend(f'{message}', debug=debug)
|
||||
print(f"{message}", flush=True)
|
Reference in New Issue
Block a user