-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathutil_logging_wilayah_kab.py
28 lines (20 loc) · 1018 Bytes
/
util_logging_wilayah_kab.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import logging
def pecker(file_name, message_string):
logging.basicConfig(filename='log_wilayah_kab.log', filemode='a', format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S')
logging.warning(message_string)
# logging.basicConfig(filename=file_name, filemode='a', format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S')
# logging.warning(message_string)
# formatter = logging.Formatter('%(asctime)s - %(message)s','%d-%b-%y %H:%M:%S')
# handler_any = logging.FileHandler('log_ALL_DATA.log')
# handler_any.setFormatter(formatter)
# logger_any = logging.getLogger('any_data')
# logger_any.setLevel(logging.INFO)
# logger_any.addHandler(handler_any)
# logger_any.info(message_string)
# handler = logging.FileHandler(file_name)
# handler.setFormatter(formatter)
# logger = logging.getLogger(file_name)
# logger.setLevel(logging.INFO)
# logger.addHandler(handler)
# logger.info(message_string)
return