Skip to content

Commit e20f127

Browse files
committed
Add Log file fix.
1 parent 1fbef9e commit e20f127

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ms_graph/session.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json as json_lib
22
import requests
33
import logging
4+
import pathlib
45

56
from typing import Dict
67

@@ -32,6 +33,10 @@ def __init__(self, client: object) -> None:
3233
# We can also add custom formatting to our log messages.
3334
log_format = '%(asctime)-15s|%(filename)s|%(message)s'
3435

36+
if not pathlib.Path('logs').exists():
37+
pathlib.Path('logs').mkdir()
38+
pathlib.Path('logs/log_file_custom.log').touch()
39+
3540
self.client: MicrosoftGraphClient = client
3641
logging.basicConfig(
3742
filename="logs/log_file_custom.log",

tests/test_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from ms_graph.search import Search
1111
from ms_graph.drives import Drives
1212
from ms_graph.groups import Groups
13-
from ms_graph.session import GraphSession
1413
from ms_graph.drive_items import DriveItems
1514
from ms_graph.personal_contacts import PersonalContacts
1615

0 commit comments

Comments
 (0)