Ejemplo n.º 1
0
    except Exception:
        trans_log.error(unicode(self))
        return ""


Markup.__mod__ = new

import djcelery

djcelery.setup_loader()

# Import for side-effect: configures our logging handlers.
# pylint: disable-msg=W0611
from lib.log_settings_base import log_configure

log_configure()

newrelic_ini = getattr(settings, "NEWRELIC_INI", None)
load_newrelic = False

if newrelic_ini:
    import newrelic.agent

    try:
        newrelic.agent.initialize(newrelic_ini)
        load_newrelic = True
    except:
        startup_logger = logging.getLogger("z.startup")
        startup_logger.exception("Failed to load new relic config.")

if __name__ == "__main__":
Ejemplo n.º 2
0
def configure_logging():
    """Configure the `logging` module to route logging based on settings
    in our various settings modules and defaults in `lib.log_settings_base`."""
    from lib.log_settings_base import log_configure

    log_configure()
Ejemplo n.º 3
0
site.addsitedir(path('apps'))

import session_csrf
session_csrf.monkeypatch()

# Fix jinja's Markup class to not crash when localizers give us bad format
# strings.
from jinja2 import Markup
mod = Markup.__mod__
trans_log = logging.getLogger('z.trans')

# Load this early so that anything else you import will use these log settings.
# Mostly to shut Raven the hell up.
from lib.log_settings_base import log_configure
log_configure()

# waffle and amo form an import cycle because amo patches waffle and
# waffle loads the user model, so we have to make sure amo gets
# imported before anything else imports waffle.
import amo

# Hardcore monkeypatching action.
import jingo.monkey
jingo.monkey.patch()


def new(self, arg):
    try:
        return mod(self, arg)
    except Exception:
Ejemplo n.º 4
0
def configure_logging():
    """Configure the `logging` module to route logging based on settings
    in our various settings modules and defaults in `lib.log_settings_base`."""
    from lib.log_settings_base import log_configure

    log_configure()