def get_logger(module=None): from frappe.setup_logging import setup_logging global logging_setup_complete if not logging_setup_complete: setup_logging() logging_setup_complete = True return logging.getLogger(module or "frappe")
def get_logger(module=None, loglevel="DEBUG"): from frappe.setup_logging import setup_logging global logging_setup_complete if not logging_setup_complete: setup_logging() logging_setup_complete = True logger = logging.getLogger(module or "frappe") logger.setLevel(logging.DEBUG) return logger
import frappe import frappe.handler import frappe.auth import frappe.api import frappe.utils.response import frappe.website.render from frappe.utils import get_site_name from frappe.middlewares import StaticDataMiddleware from frappe.setup_logging import setup_logging local_manager = LocalManager([frappe.local]) _site = None _sites_path = os.environ.get("SITES_PATH", ".") setup_logging() logger = logging.getLogger(__name__) @Request.application def application(request): frappe.local.request = request frappe.local.is_ajax = frappe.get_request_header("X-Requested-With")=="XMLHttpRequest" response = None try: rollback = True init_site(request) if frappe.local.conf.get('maintainance_mode'): raise frappe.SessionStopped