pcdsutils.log.configure_pcds_logging

pcdsutils.log.configure_pcds_logging(file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, *, log_host: str = 'ctl-logsrv01.pcdsn', log_port: int = 54320, protocol: str = 'tcp', level: str = 'DEBUG')[source]

Set a new handler on the logging.getLogger('pcds-logging') logger.

If this is called more than once, the handler from the previous invocation is removed (if still present) and replaced.

Parameters:
log_hoststr, optional

The log host server host. Defaults to the environment variable PCDS_LOG_HOST.

log_portint, optional

The log host server port. Defaults to the environment variable PCDS_LOG_PORT.

protocol{‘tcp’, ‘udp’}

Use UDP or TCP as the transport protocol. Defaults to the environment variable PCDS_LOG_PROTO.

levelstr or int

Minimum logging level, given as string or corresponding integer. Default is ‘DEBUG’.

Returns:
handlerlogging.Handler

The handler, which has already been added to the ‘pcds-logging’ logger.