Attention
You are viewing PyUnity docs under the develop
branch.
As such, they are only applicable if you installed from source.
Go to https://docs.pyunity.x10.bz/en/latest/ for the most recent
release.
pyunity.logger module¶
Source code: pyunity/logger.py
Utility functions to log output of PyUnity.
This will be imported as pyunity.Logger
.
- class pyunity.logger.Level[source]¶
Bases:
object
Represents a level or severity to log. You should never instantiate this directly, instead use one of
Logging.OUTPUT
,Logging.INFO
,Logging.DEBUG
,Logging.ERROR
orLogging.WARN
.
- class pyunity.logger.Special[source]¶
Bases:
object
Class to represent a special line to log. You should never instantiate this class, instead use one of
Logger.RUNNING_TIME
orLogger.ELAPSED_TIME
.
- pyunity.logger.LogLine(level, *message, stacklevel=1, silent=False)[source]¶
Logs a line in
latest.log
found in these two locations: Windows:%appdata%\PyUnity\Logs\latest.log
Other:/tmp/pyunity/logs/latest.log
- Parameters:
level (Level) – Level or severity of log.
- pyunity.logger.LogException(e, stacklevel=1, silent=False)[source]¶
Log an exception.
- Parameters:
e (Exception) – Exception to log
- pyunity.logger.LogTraceback(exctype, value, tb)[source]¶
Log an exception.
- Parameters:
exctype (type) – Type of exception that is to be raised
value (Any) – Value of the exception contents
tb (traceback) – Traceback object to log
Notes
This function is not meant to be used by general users.
- pyunity.logger.LogSpecial(level, type)[source]¶
Log a line of level
level
with a special line that is generated at runtime.