pyATS Log: Logging Format and Utilities

26.3 · active · verified Thu Apr 16

pyATS Log is a sub-component of the Cisco pyATS (Python Automated Test System) ecosystem, providing logging format and utilities. It configures the standard Python logging module to output in a Cisco log format, integral for network automation and testing workflows. The library is currently at version 26.3 and follows a frequent, often monthly or bi-monthly, release cadence as part of the broader pyATS framework.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to obtain a standard Python logger instance, which `pyATS` automatically configures for Cisco log format output. It also shows the use of a specific `pyats.log.utils` helper, `banner`, for improved log readability.

import logging
from pyats.log.utils import banner

# Get a logger instance; pyATS configures it to Cisco log format automatically
logger = logging.getLogger(__name__)

# Log some messages
logger.info('Starting a pyATS-driven task.')
logger.debug('Detailed debug information for troubleshooting.')
logger.warning('This is a warning that something might be off.')
logger.error('An error occurred during processing!')

# Use a pyATS log utility for visual separation
logger.info(banner('Task Completed'))

view raw JSON →