From 48b9fb9b9098fae3444d57f301ca556a0fde84c1 Mon Sep 17 00:00:00 2001 From: Joshua Hiller <74007258+jshcodes@users.noreply.github.com> Date: Fri, 1 Nov 2024 09:48:16 -0400 Subject: [PATCH] Add FalconPy native logging support (#220) --- caracara/client.py | 6 ++++++ examples/config.example.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/caracara/client.py b/caracara/client.py index 077bf45..c260e7c 100644 --- a/caracara/client.py +++ b/caracara/client.py @@ -60,6 +60,9 @@ def __init__( # pylint: disable=R0913,R0914,R0915 proxy: str = None, user_agent: str = None, verbose: bool = False, + debug: bool = False, + debug_record_count: int = None, + sanitize_log: bool = True, falconpy_authobject: OAuth2 = None, ): """Configure a Caracara Falcon API Client object.""" @@ -110,6 +113,9 @@ def __init__( # pylint: disable=R0913,R0914,R0915 "user_agent": user_agent, "ssl_verify": ssl_verify, "timeout": timeout, + "debug": debug, + "debug_record_count": debug_record_count, + "sanitize_log": sanitize_log, } self.logger.info( diff --git a/examples/config.example.yml b/examples/config.example.yml index b17837d..44025a6 100644 --- a/examples/config.example.yml +++ b/examples/config.example.yml @@ -4,6 +4,12 @@ profiles: client_id: clientid123456 client_secret: clientsecret123456 cloud_name: auto + # Enable FalconPy native debugging by setting to True + debug: False + # Number of records to return in a debug + debug_record_count: 100 + # Do not disable log sanitization in production environments + sanitize_log: True logging: level: debug examples: