7518583e23
There was no reason for the IPSC class to contain the function for processing a peer list. It makes the class more self-sustaining, but the goal should be a *module* to handle connection maintenance. I moved the peer list process, and built a mode decoder function from the previos mode printing function, as well as added decoded mode items to the data structure… and cleaned up the prining function so it doesn't re-process the data.
56 lines
1.4 KiB
Python
56 lines
1.4 KiB
Python
# Logging system configuration
|
|
|
|
from logging.config import dictConfig
|
|
import logging
|
|
|
|
dictConfig({
|
|
'version': 1,
|
|
'disable_existing_loggers': False,
|
|
'filters': {
|
|
},
|
|
'formatters': {
|
|
'verbose': {
|
|
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
|
|
},
|
|
'timed': {
|
|
'format': '%(levelname)s %(asctime)s %(message)s'
|
|
},
|
|
'simple': {
|
|
'format': '%(levelname)s %(message)s'
|
|
},
|
|
},
|
|
'handlers': {
|
|
'console': {
|
|
'level': 'DEBUG',
|
|
'class': 'logging.StreamHandler',
|
|
'formatter': 'simple'
|
|
},
|
|
'file': {
|
|
'level': 'DEBUG',
|
|
'class': 'logging.FileHandler',
|
|
'formatter': 'simple',
|
|
'filename': '/tmp/ipsc.log',
|
|
},
|
|
'console-timed': {
|
|
'level': 'DEBUG',
|
|
'class': 'logging.StreamHandler',
|
|
'formatter': 'timed'
|
|
},
|
|
'file-timed': {
|
|
'level': 'DEBUG',
|
|
'class': 'logging.FileHandler',
|
|
'formatter': 'timed',
|
|
'filename': '/tmp/ipsc.log',
|
|
},
|
|
},
|
|
'loggers': {
|
|
'ipsc': {
|
|
# 'handlers': ['file-timed', 'console-timed'],
|
|
'handlers': ['file', 'console'],
|
|
'level': 'INFO',
|
|
'propagate': True,
|
|
}
|
|
}
|
|
})
|
|
logger = logging.getLogger('ipsc')
|