plugin = plugin.strip(' \n')
module = 'sima.plugins.{0}.{1}'.format(source, plugin.lower())
try:
plugin = plugin.strip(' \n')
module = 'sima.plugins.{0}.{1}'.format(source, plugin.lower())
try:
'{0} ({1})'.format(module, err))
sima.shutdown()
sys.exit(1)
try:
plugin_obj = getattr(mod_obj, plugin)
except AttributeError as err:
'{0} ({1})'.format(module, err))
sima.shutdown()
sys.exit(1)
try:
plugin_obj = getattr(mod_obj, plugin)
except AttributeError as err:
- logfile = config.get('log', 'logfile')
+ # set logger
+ logger = logging.getLogger('sima')
+ logfile = config.get('log', 'logfile', fallback=None)
verbosity = config.get('log', 'verbosity')
set_logger(verbosity, logfile)
verbosity = config.get('log', 'verbosity')
set_logger(verbosity, logfile)
# Create Database
db_file = config.get('sima', 'db_file')
if (sopt.options.get('create_db', None)
# Create Database
db_file = config.get('sima', 'db_file')
if (sopt.options.get('create_db', None)
- or not isfile(db_file)):
- logger.info('Creating database in "{}"'.format(db_file))
+ or not isfile(db_file)):
+ logger.info('Creating database in "%s"', db_file)
open(db_file, 'a').close()
SimaDB(db_path=db_file).create_db()
if sopt.options.get('create_db', None):
logger.info('Done, bye...')
sys.exit(0)
open(db_file, 'a').close()
SimaDB(db_path=db_file).create_db()
if sopt.options.get('create_db', None):
logger.info('Done, bye...')
sys.exit(0)
- logger.info('Starting...')
+ if sopt.options.get('generate_config'):
+ config.write(sys.stdout, space_around_delimiters=True)
+ sys.exit(0)
+
+ logger.info('Starting (%s)...', info.__version__)