Skip to content

# trtorch.logging

class `trtorch.logging.` `Level` ( value )

  Bases: `enum.Enum`

  Enum to set the minimum required logging level to print a message to stdout

  `Debug` = LogLevel.DEBUG
  `Error` = LogLevel.ERROR
  `Info` = LogLevel.INFO
  `InternalError` = LogLevel.INTERNAL_ERROR
  `Warning` = LogLevel.WARNING

`trtorch.logging.` `get_is_colored_output_on` ( ) → bool

  Get if colored output is enabled for logging

  Returns

    If colored output is one

  Return type

    bool

`trtorch.logging.` `get_logging_prefix` ( ) → str

  Get the prefix set for logging messages

  Returns

    Prefix used for logger

  Return type

    str

`trtorch.logging.` `get_reportable_log_level` ( ) → trtorch.logging.Level

  Get the level required for a message to be printed in the log

  Returns

    The enum representing the level required to print

  Return type

    trtorch.logging.Level

`trtorch.logging.` `log` ( level : trtorch.logging.Level , msg : str )

  Add a new message to the log

  Adds a new message to the log at a specified level. The message will only get printed out if Level > reportable_log_level

  Parameters

    - level ( trtorch.logging.Level ) – Severity of the message

    - msg ( str ) – Actual message text

`trtorch.logging.` `set_is_colored_output_on` ( colored_output_on : bool )

  Enable or disable color in the log output

  Parameters

    colored_output_on ( bool ) – If colored output should be enabled or not

`trtorch.logging.` `set_logging_prefix` ( prefix : str )

  Set the prefix used when logging messages

  Parameters

    prefix ( str ) – Prefix to use for logging messages

`trtorch.logging.` `set_reportable_log_level` ( level : trtorch.logging.Level )

  Set the level required for a message to be printed to the log

  Parameters

    level ( trtorch.logging.Level ) – The enum representing the level required to print