Skip to content

Commit 8eab93b

Browse files
update logs in SpreadheetToYaDiskDuplicator
1 parent 281f534 commit 8eab93b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

scripts/spreadsheet_to_yadisk_duplicator.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#!/usr/bin/env python3
22
"""
33
Модуль для экспорта таблиц и загрузки на Яндекс.Диск
4-
Заменитель bash-скрипта duplicate_to_yadisk.sh
54
"""
65

76
import argparse
87
import csv
9-
from io import StringIO
108
import logging
119
import sys
1210
from pathlib import Path
@@ -17,7 +15,7 @@
1715

1816
logging.basicConfig(
1917
level=logging.INFO,
20-
format="%(asctime)s - %(levelname)s - %(message)s",
18+
format="%(levelname) -10s %(asctime)s %(module)s:%(lineno)s %(funcName)s %(message)s",
2119
handlers=[
2220
logging.StreamHandler(sys.stdout),
2321
],
@@ -110,11 +108,11 @@ def process_data(
110108
)
111109

112110
if not export_success:
113-
raise Exception(f"process_export: download_sheet error")
111+
raise Exception(f"download_sheet error")
114112

115113
public_link = self.upload_file_to_disk(f"{export_name}.{export_format}")
116114
if not public_link:
117-
raise Exception(f"process_export: upload_file_to_disk error")
115+
raise Exception(f"upload_file_to_disk error")
118116
return public_link
119117

120118
def upload_file_to_disk(self, file_path: str):

0 commit comments

Comments
 (0)