-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlog.pyi
More file actions
86 lines (61 loc) · 3.02 KB
/
Copy pathlog.pyi
File metadata and controls
86 lines (61 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
"""
Function:
A log is a tool used to record the runtime state of an application in program development, as well as help developers diagnose and troubleshoot problems. Developers can quickly identify the root causes of problems and better understand the behaviors and performance of applications by viewing logs. log feature can output different log levels, including the DEBUG level, WARNING level, and ERROR level.
Descriptions taken from:
https://python.quectel.com/doc/quecpython/API_reference/en/syslib/log.html
"""
# Constant of log level. The most detailed information is recorded at the DEBUG level and this level is usually used in development and debugging.
DEBUG: int = ...
# Constant of log level. The information recorded at the INFO level indicates that everything is running normally.
INFO: int = ...
# Constant of log level. The information recorded at the WARNING level indicates that something unexpected has occurred or potentially harmful events, but the application can continue to function normally.
WARNING: int = ...
# Constant of log level. The information recorded at the ERROR level indicates that an application is no longer able to execute certain functions due to some serious problems.
ERROR: int = ...
# Constant of log level. The information recorded at the CRITICAL level indicates a critical error in the application that may stop the application from running.
CRITICAL: int = ...
def basicConfig(level):
"""Sets the log output level. Default level: log.INFO. The system will only output logs whose levels are greater than or equal to that level.
:param level: Log level.
:return: None
"""
def set_output(out):
"""Destination where the logs are output. Currently only uart and usys.stdout are supported.
:param out: The destination where the logs are output. Set the parameter to a specified serial port or the interaction port. Default value: the interaction port.
:return: None
"""
def getLogger(name) -> Logger:
"""Gets the log object which supports logs of different levels.
:param name: String type. The topic of the current log object
:return: A log handle (log object) with the method of outputting logs.
"""
class Logger(object):
def __init__(self, name):
"""
:param name: logger name
"""
def debug(self, msg):
"""Outputs the DEBUG-level logs.
:param msg: String type. The content of logs.
:return:
"""
def info(self, msg):
"""Outputs the INFO-level logs.
:param msg: String type. The content of logs.
:return:
"""
def warning(self, msg):
"""Outputs the WARNING-level logs.
:param msg: String type. The content of logs.
:return:
"""
def error(self, msg):
"""Outputs the ERROR-level logs.
:param msg: String type. The content of logs.
:return:
"""
def critical(self, msg):
"""Outputs the CRITICAL-level logs.
:param msg: String type. The content of logs.
:return:
"""