Skip to content

Commit 8968533

Browse files
committed
Force SDK logs, set output to file
1 parent e3a5278 commit 8968533

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

splunklib/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@
2929
def setup_logging(
3030
level, log_format=DEFAULT_LOG_FORMAT, date_format=DEFAULT_DATE_FORMAT
3131
):
32-
logging.basicConfig(level=level, format=log_format, datefmt=date_format)
32+
logging.basicConfig(
33+
filename="sdk.log",
34+
level=level,
35+
format=log_format,
36+
datefmt=date_format,
37+
force=True,
38+
)
3339

3440

3541
__version_info__ = (2, 1, 0)

tests/testlib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
filename="test.log",
4141
level=logging.DEBUG,
4242
format="%(asctime)s:%(levelname)s:%(message)s",
43+
force=True,
4344
)
4445

4546

0 commit comments

Comments
 (0)