Skip to contents

This function adds logging capability to a list of connections by modifying their class attributes. It ensures that the input is of the correct type and registers the necessary S3 methods for logging.

Usage

add_logs(connections)

Arguments

connections

An object of class connector::connectors(). This should be a list of connection objects to which logging capability will be added.

Value

The modified connections object with logging capability added. Each connection in the list will have the "connector_logger" class prepended to its existing classes.

Details

The function performs the following steps:

  1. Checks if the input connections is of class "connectors".

  2. Registers the S3 methods for logging using connector.logger::cnt_logger_S3_register().

  3. Iterates through each connection in the list and prepends the "connector_logger" class.

Examples

if (FALSE) {
logged_connections <- add_logs(my_connections)
}