Registry / testing / pyats-log

pyats-log

JSON →
library26.5pypypi✓ verified 87d ago

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.

pip install pyats-log
INSTALL
IMPORT
SIG · PYATS-LOG
P
pyats-log
testingpythonv26.5
Install
8.6s avg
Import
15ms
Disk
64MB
Pass rate
7/ 10
Env Coverage7 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v26.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 9.38s
py 3.11
✕ build_error
✓ 8.19s
py 3.12
✕ build_error
✓ 6.71s
py 3.13
✕ build_error
✓ 7.13s
py 3.9
✓ —
✓ 11.65s
64MB installed
● package 64MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

logging
import logging
The primary way to interact with pyATS logging, as it wraps the standard Python logging module.
banner
from pyats.log.utils import banner
import pyats.log.utils.banner
The 'banner' utility for log formatting is directly imported from `pyats.log.utils`.

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'))
Debug
Known issues
gotchapyATS and its sub-components, including `pyats-log`, officially support Python 3.8+ on Linux and Mac systems. Windows platforms are explicitly not supported, which can lead to unexpected behavior or installation failures.
fix
Run pyATS on a supported operating system (Linux or macOS), or within a Linux-based virtual machine or Docker container on Windows.
affects: All versions
gotchaWhen running pyATS scripts, particularly those involving device connections, the framework automatically generates log files (e.g., `[device]-cli-[timestamp].log`) in the script directory. This behavior cannot always be easily disabled and might be unexpected, leading to numerous log files accumulating.
fix
Be aware of automatic log generation. Manage generated log files through cleanup scripts or direct deletion. For specific cases, consult the latest pyATS documentation or GitHub issues for potential configuration options to reduce logging verbosity or location, though full disabling may not be available.
affects: All versions, including 25.7 where it was a known issue.
breakingpyATS has ceased official support for Python 3.9. Projects still running on Python 3.9 will not receive updates or fixes and may encounter compatibility issues with newer pyATS versions.
fix
Upgrade your Python environment to Python 3.10 or a later supported version (e.g., Python 3.11, 3.12, 3.13 as pyATS prepares for their support).
affects: Versions 25.11 and later (from November 2025 onwards)
gotchaThe `pyats logs view` CLI command is designed to view logs *generated by pyATS runs*, not for parsing arbitrary syslog files or general text log files. Attempting to use it on non-pyATS logs will often result in an empty display or parsing errors.
fix
Use `pyats logs view` exclusively for logs produced by pyATS jobs. For parsing general syslog or other formatted text logs, utilize dedicated parsing libraries or custom scripts (e.g., using `Genie` parsers within the pyATS ecosystem if the logs are from Cisco devices).
affects: All versions
Errors
Common errors & fixes
PyATS: Cannot disable pyats log file from being created
pyATS automatically generates log files for device interactions as part of its core functionality, which is not easily configurable to be disabled.
fix
This is a known behavior of the pyATS framework. There is no direct configuration to completely disable these files. Implement post-execution cleanup scripts to remove unwanted log files or configure your `pyats run job` command to output to a specific, temporary directory that can be cleared.
ModuleNotFoundError: No module named 'pyats.log.utils'
The `pyats-log` package or the broader `pyats` framework is either not installed, or the Python environment where the script is run does not have access to the installed package.
fix
Ensure `pyats` is installed in your active Python environment using `pip install pyats` (recommended for full functionality) or `pip install pyats-log` if you only need the logging component. Activate the correct virtual environment if one is being used.
pyats logs view /path/to/my/syslog.log -> (empty browser window or parsing errors)
The `pyats logs view` command is intended for viewing logs generated by pyATS's internal execution engine, not for general syslog files or arbitrary text logs.
fix
Only use `pyats logs view` for log archives created by `pyats run job`. For parsing network device syslog or debug outputs, leverage `Genie` parsers, which are part of the pyATS ecosystem, or write custom Python parsing logic.
Upgrade
Version history
26.5latest on PyPI · released May 28, 2026
Audit
Dependencies
pyatsrequiredCore framework that pyats-log integrates with and extends. When installing `pyats-log` directly, `pyats` is typically a dependency.
Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
2
Resources
pyats-log — pip install pyats-log · libregistry