-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
93 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
|
||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import configparser | ||
import logging | ||
import logging.handlers as handlers | ||
import os | ||
from concurrent_log_handler import ConcurrentRotatingFileHandler | ||
|
||
|
||
|
||
|
||
initfile="config/config.ini" | ||
configParser = configparser.ConfigParser() | ||
configParser.read(initfile) | ||
|
||
|
||
|
||
path = configParser.get('LOG_DETAILS', 'foldername') | ||
if not os.path.exists(path): | ||
os.makedirs(path) | ||
|
||
|
||
|
||
|
||
#logger | ||
log_file = configParser.get('LOG_DETAILS', 'filename') | ||
# print("..........file:",log_file) | ||
# log_file1 = os.path.abspath(path) | ||
# print(".................................................",log_file1) | ||
file_size = configParser.get('LOG_DETAILS', 'maxbytes') | ||
file_size=int(file_size) | ||
file_count = configParser.get('LOG_DETAILS', 'backupCount') | ||
file_count=int(file_count) | ||
|
||
logger = logging.getLogger() | ||
if not logger.handlers: | ||
formatter = logging.Formatter('%(asctime)s -%(lineno)d - %(levelname)s - %(message)s') | ||
logger.setLevel(logging.DEBUG) | ||
logHandler = ConcurrentRotatingFileHandler(log_file, maxBytes=file_size, backupCount=file_count) | ||
logHandler.setFormatter(formatter) | ||
logger.addHandler(logHandler) | ||
logger.info("logger implemented") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from Inscape import * | ||
|
||
def getProperties(section,key): | ||
try: | ||
options = configParser.get(section,key) | ||
return options | ||
except: | ||
print("unknown section:",section,key) | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[DATABASE] | ||
|
||
name= inscape | ||
user= postgres | ||
password= postgres | ||
host= localhost | ||
|
||
|
||
[LOG_DETAILS] | ||
|
||
filename =Log/Inscape.log | ||
maxBytes=15000000 | ||
backupCount=10 | ||
foldername= Log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters