File indexing completed on 2026-04-25 08:29:11
0001
0002 """
0003 Example agent using REST logging for swf-monitor.
0004
0005 To run this example, first install swf-common-lib:
0006 pip install swf-common-lib
0007
0008 Or if developing locally:
0009 pip install -e /path/to/swf-common-lib
0010 """
0011
0012 import logging
0013 from swf_common_lib.rest_logging import setup_rest_logging
0014
0015
0016 logger = setup_rest_logging(
0017 app_name='my_agent',
0018 instance_name='agent_001'
0019 )
0020
0021
0022 logger.info("Agent starting up")
0023 logger.debug("Connecting to data source")
0024 logger.info("Processing workflow step 1")
0025 logger.warning("Step took longer than expected")
0026 logger.error("Failed to process item 42")
0027 logger.info("Agent shutting down")