comet.logger

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

Methods

comet.logger.log(message: str, category: str = '', logLevel: int = 300) None

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::log

comet.logger.error(message: str, category: str = '') None

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::error

comet.logger.warning(message: str, category: str = '') None

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::warning

comet.logger.info(message: str, category: str = '') None

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::info

comet.logger.debug(message: str, category: str = '') None

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::debug

comet.logger.trace(message: str, category: str = '') None

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::trace

comet.logger.getPattern(category: str) str

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::get_pattern

comet.logger.setPattern(category: str, pattern: str) None

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::set_pattern

comet.logger.getEscaping(category: str) str

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::get_escaping

comet.logger.setEscaping(category: str, escaping: str) None

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::set_escaping

comet.logger.getPath(category: str) str

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::get_path

comet.logger.setPath(category: str, path: str) None

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::set_path

comet.logger.getLevel(category: str) int

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::get_level

comet.logger.setLevel(category: str, level: int) None

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:

InDesign® comet_pdf® Illustrator®

CScript:

logger::set_level

comet.logger.reloadConfig() None

Reload all configurations from log.xml

Return type:

None

Available:

InDesign® comet_pdf® Illustrator®