Skip to content

Commit cbbf61c

Browse files
committed
logs update
1 parent 6fbade8 commit cbbf61c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

configurator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import json
22
import logging
33

4-
logging.basicConfig(filename='log.log', encoding='utf-8', level=logging.INFO,
5-
format='%(asctime)s %(message)s', datefmt='%Y/%m/%d %I:%M:%S %p')
4+
logging.basicConfig(filename='log', encoding='utf-8', level=logging.INFO,
5+
format='%(asctime)s | %(message)s', datefmt='%Y/%m/%d %I:%M:%S %p')
66

77

88
class Configurator:
@@ -22,15 +22,15 @@ def read_config_file(self, config_file_name: str = "config.json"):
2222
for key, value in data.items():
2323
setattr(self, key, value)
2424
except Exception as e:
25-
logging.info(f"File will be created and hard coded values will be applied. {str(e)}")
25+
logging.info(f"{str(e)} \n- File will be created and hard coded values will be applied. ")
2626

2727
def save_config_file(self, config_file_name: str = "config.json"):
2828
try:
2929
conf_items = {k: v for k, v in vars(self).items() if isinstance(v, (int, float, str, bool, list, dict))}
3030
with open(config_file_name, "w") as conf_file:
3131
json.dump(conf_items, conf_file, sort_keys=False, indent=2)
3232
except Exception as e:
33-
logging.error(f"Error occurred while saving {config_file_name}: {str(e)}")
33+
logging.error(f"{str(e)} \n- Error occurred while saving: {config_file_name}")
3434

3535
def get_value(self, key):
3636
"""Extracts a specific key-value pair from the class attributes"""

functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from multiprocess import Process
77

88

9-
logging.basicConfig(filename='log.log', encoding='utf-8', level=logging.INFO,
10-
format='%(asctime)s %(message)s', datefmt='%Y/%m/%d %I:%M:%S %p')
9+
logging.basicConfig(filename='log', encoding='utf-8', level=logging.INFO,
10+
format='%(asctime)s | %(message)s', datefmt='%Y/%m/%d %I:%M:%S %p')
1111

1212
keys_list = ['ALT', 'CTRL', 'SHIFT', 'WINDOWS',
1313
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',

main.pyw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ from threading import Thread, Event
1212
from mouse_jiggler import jiggler
1313
from configurator import Configurator
1414

15-
logging.basicConfig(filename='log.log', encoding='utf-8', level=logging.INFO,
16-
format='%(asctime)s %(message)s', datefmt='%Y/%m/%d %I:%M:%S %p')
15+
logging.basicConfig(filename='log', encoding='utf-8', level=logging.INFO,
16+
format='%(asctime)s | %(message)s', datefmt='%Y/%m/%d %I:%M:%S %p')
1717

1818

1919
def about_window():

0 commit comments

Comments
 (0)