Skip to content

Commit

Permalink
feat: adding logging config parameter
Browse files Browse the repository at this point in the history
Signed-off-by: chandanchowdhury <[email protected]>
  • Loading branch information
chandanchowdhury committed Nov 27, 2024
1 parent 076ef78 commit 7327354
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cartography/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import getpass
import logging
import logging.config
import os
import sys
from typing import Optional
Expand Down Expand Up @@ -111,6 +112,14 @@ def _build_parser(self):
'See https://neo4j.com/docs/api/python-driver/4.4/api.html#database.'
),
)
parser.add_argument(
'--logging-config',
type=str,
default=None,
help=(
'Path to file containing Python logging configuration'
),
)
parser.add_argument(
'--selected-modules',
type=str,
Expand Down
4 changes: 4 additions & 0 deletions cartography/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class Config:
:param neo4j_database: The name of the database in Neo4j to connect to. If not specified, uses your Neo4j database
settings to infer which database is set to default.
See https://neo4j.com/docs/api/python-driver/4.4/api.html#database. Optional.
:type logging_config: str
:param logging_config: Path to the file containing logging configuration.
:type selected_modules: str
:param selected_modules: Comma-separated list of cartography top-level modules to sync. Optional.
:type update_tag: int
Expand Down Expand Up @@ -120,6 +122,7 @@ def __init__(
neo4j_password=None,
neo4j_max_connection_lifetime=None,
neo4j_database=None,
logging_config=None,
selected_modules=None,
update_tag=None,
aws_sync_all_profiles=False,
Expand Down Expand Up @@ -176,6 +179,7 @@ def __init__(
self.neo4j_password = neo4j_password
self.neo4j_max_connection_lifetime = neo4j_max_connection_lifetime
self.neo4j_database = neo4j_database
self.logging_config - logging_config
self.selected_modules = selected_modules
self.update_tag = update_tag
self.aws_sync_all_profiles = aws_sync_all_profiles
Expand Down

0 comments on commit 7327354

Please sign in to comment.