Skip to content

Logger Component

The logger can be used to log output to the Cereal application. This output is made visible on screen to provide information to the user.

Usage

When implementing your script's onStart, execute, or onFinish methods, you can access the Logger component through the provided ComponentProvider.

fun execute(provider: ComponentProvider) {
    val logger = provider.logger()

    // Basic logging
    logger.info("Processing item 1/10")

    // Log different levels
    logger.debug("Detailed debug information")
    logger.info("General information")
    logger.warning("Warning message")
    logger.error("Error encountered")
}

Best Practices

  • Only provide information that could be relevant to the user
  • Do not flood the user interface with excessive logging
  • Use appropriate log levels for different types of messages
  • For critical notifications that need immediate attention, consider using the Notification component instead