def get_plugin_manager(): if get_settings().get_plugins_enabled(): from yapsy.PluginManager import PluginManagerSingleton return PluginManagerSingleton.get() else: from lunchinator.log import getCoreLogger getCoreLogger().exception("Cannnot load plugin manager: plugins are disabled")
def get_connection_type(logger, name=None): from lunchinator.log import getCoreLogger if not get_settings().get_plugins_enabled(): getCoreLogger().warning("Plugins are disabled, cannot get DB connections.") return None pluginInfo = get_plugin_manager().getPluginByName("Database Settings", "general") if pluginInfo and pluginInfo.plugin_object.is_activated: return pluginInfo.plugin_object.getConnectionType(logger, name) getCoreLogger().error("getDBConnection: DB Connections plugin not yet loaded") return None
def logs_debug(): from log import getCoreLogger import logging return getCoreLogger().isEnabledFor(logging.DEBUG)
def log_debug(*s): from log import getCoreLogger getCoreLogger().debug(_generate_string(*s))
def log_info(*s): from log import getCoreLogger getCoreLogger().info(_generate_string(*s))
def log_warning(*s): from log import getCoreLogger getCoreLogger().warn(_generate_string(*s))
def log_error(*s): from log import getCoreLogger getCoreLogger().error(_generate_string(*s))
def log_critical(*s): from log import getCoreLogger getCoreLogger().critical(_generate_string(*s))
def log_exception(*s): from log import getCoreLogger getCoreLogger().exception(_generate_string(*s))