comet.logger

Like the CScript class, the logger module provides advanced logging functionality during script execution.

Methods

comet.logger.log(message, category='', logLevel=300)

Print a log message with the given priority to the logger specified by category.

A suitable configuration must exist for this category or any of it’s ancestors, otherwise nothing is printed (see general configuration hints for this module above).

If category is empty, the standard category (e.g. com.priint.indesigncc2020.comet) is used.

Parameters
  • message (str) – The message to log

  • category (str) – Name of the logger / category

  • logLevel (int) –

    Log level

    Allowed values:

    • 100 : error

    • 200 : warning

    • 300 : info

    • 400 : debug

    • 500 : trace

Return type

None

Raises
  • TypeError – When parameter types are invalid

  • ValueError – When parameter logLevel has invalid value

Available

CScript

logger::log

comet.logger.error(message, category='')

Print a log message with the priority error to the logger specified by category.

Parameters
  • message (str) – The message to log

  • category (str) – Name of the logger / category

Return type

None

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::error

comet.logger.warning(message, category='')

Print a log message with the priority warning to the logger specified by category.

Parameters
  • message (str) – The message to log

  • category (str) – Name of the logger / category

Return type

None

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::warning

comet.logger.info(message, category='')

Print a log message with the priority info to the logger specified by category.

Parameters
  • message (str) – The message to log

  • category (str) – Name of the logger / category

Return type

None

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::info

comet.logger.debug(message, category='')

Print a log message with the priority debug to the logger specified by category.

Parameters
  • message (str) – The message to log

  • category (str) – Name of the logger / category

Return type

None

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::debug

comet.logger.trace(message, category='')

Print a log message with the priority trace to the logger specified by category.

Parameters
  • message (str) – The message to log

  • category (str) – Name of the logger / category

Return type

None

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::trace

comet.logger.getPattern(category)

Get the pattern of a category.

The category or any of it’s ancestors must be configured in the log.xml file

Parameters

category (str) – Name of the logger / category

Returns

The pattern of the category

Return type

str

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::get_pattern

comet.logger.setPattern(category, pattern)

Set the pattern of a category.

The category or any of it’s ancestors must be configured in the log.xml file

Parameters
  • category (str) – Name of the logger / category

  • pattern (str) – New pattern

Return type

None

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::set_pattern

comet.logger.getEscaping(category)

Get the escaping of a category.

The category or any of it’s ancestors must be configured in the log.xml file

Parameters

category (str) – Name of the logger / category

Returns

The escaping of the category

Possible values:

  • ’XML’

  • ’C’

  • ’JSON’

  • ’URL’

  • ’BASE64’

  • ’NONE’

  • ’UNKNOWN’

Return type

str

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::get_escaping

comet.logger.setEscaping(category, escaping)

Set the escaping of a category.

The category or any of it’s ancestors must be configured in the log.xml file

Parameters
  • category (str) – Name of the logger / category

  • escaping (str) –

    New escaping

    Allowed values:

    • ’XML’

    • ’C’

    • ’JSON’

    • ’URL’

    • ’BASE64’

    • ’NONE’

Return type

None

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::set_escaping

comet.logger.getPath(category)

Get the log path of a category.

The category or any of it’s ancestors must be configured in the log.xml file

Parameters

category (str) – Name of the logger / category

Returns

The path of the category

Return type

str

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::get_path

comet.logger.setPath(category, path)

Set the log path of a category.

The category or any of it’s ancestors must be configured in the log.xml file

Parameters
  • category (str) – Name of the logger / category

  • path (str) – New path to the logfile

Return type

None

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::set_path

comet.logger.getLevel(category)

Get the log level of a category.

The category or any of it’s ancestors must be configured in the log.xml file

Parameters

category (str) – Name of the logger / category

Returns

The log level of the category

Possible values:

  • 100 : error

  • 200 : warning

  • 300 : info

  • 400 : debug

  • 500 : trace

Return type

int

Raises

TypeError – When parameter types are invalid

Available

CScript

logger::get_level

comet.logger.setLevel(category, level)

Set the log level of a category.

The category or any of it’s ancestors must be configured in the log.xml file

Parameters
  • category (str) – Name of the logger / category

  • level (int) –

    New log level of category.

    Allowed values:

    • 100 : error

    • 200 : warning

    • 300 : info

    • 400 : debug

    • 500 : trace

Return type

None

Raises
  • TypeError – When parameter types are invalid

  • ValueError – When parameter level has invalid value

Available

CScript

logger::set_level

comet.logger.reloadConfig()

Reload all configurations from log.xml

Return type

None

Available