taichi._logging

Module Contents

Functions

set_logging_level(level)

Controls the level of detail in logs.

is_logging_effective(level)

Check if the level is effective. The level below current level will be effective.

Attributes

DEBUG

TRACE

INFO

WARN

ERROR

CRITICAL

supported_log_levels

debug

trace

info

warn

error

critical

taichi._logging.set_logging_level(level)

Controls the level of detail in logs.

See also https://docs.taichi.graphics/lang/articles/contribution/utilities#logging.

Parameters

level (str) – The string represents logging level. Effective levels include: ‘trace’, ‘debug’, ‘info’, ‘warn’, ‘error’, ‘critical’.

Example

>>> set_logging_level('debug')

If call this function, then everything below ‘debug’ will be effective, and ‘trace’ won’t since it’s above debug.

taichi._logging.is_logging_effective(level)
Check if the level is effective. The level below current level will be effective.

If not set by manual, the pre-set logging level is ‘info’.

See also https://docs.taichi.graphics/lang/articles/contribution/utilities#logging.

Parameters

level (str) – The string represents logging level. Effective levels include: ‘trace’, ‘debug’, ‘info’, ‘warn’, ‘error’, ‘critical’.

Returns

Indicate whether the logging level is supported.

Return type

Bool

Example

If current level is ‘info’:

>>> print(ti.is_logging_effective("trace"))     # False
>>> print(ti.is_logging_effective("debug"))     # False
>>> print(ti.is_logging_effective("info"))      # True
>>> print(ti.is_logging_effective("warn"))      # True
>>> print(ti.is_logging_effective("error"))     # True
>>> print(ti.is_logging_effective("critical"))  # True
taichi._logging.DEBUG = debug
taichi._logging.TRACE = trace
taichi._logging.INFO = info
taichi._logging.WARN = warn
taichi._logging.ERROR = error
taichi._logging.CRITICAL = critical
taichi._logging.supported_log_levels
taichi._logging.debug
taichi._logging.trace
taichi._logging.info
taichi._logging.warn
taichi._logging.error
taichi._logging.critical