예제 #1
0
import atexit
try:
    import cPickle as pickle
except ImportError:
    import pickle
import logging
import logging.handlers
import SocketServer
import signal
import struct
from threading import Lock

from sprout import sprout_path


logs_path = sprout_path.join("log")

logger_cache = {}

logger_cache_lock = Lock()

global_fs_lock = Lock()

MAX_FILE_SIZE = 20 * 1024 * 1024
MAX_BACKUPS = 10


def translate_sigterm_to_sigint(*args):
    raise KeyboardInterrupt

예제 #2
0
# Based on: https://docs.python.org/2.4/lib/network-logging.html
import atexit
try:
    import six.moves.cPickle as pickle
except ImportError:
    import pickle
import logging
import logging.handlers
import six.moves.socketserver
import signal
import struct
from threading import Lock

from sprout import sprout_path

logs_path = sprout_path.join("log")

logger_cache = {}

logger_cache_lock = Lock()

global_fs_lock = Lock()

MAX_FILE_SIZE = 20 * 1024 * 1024
MAX_BACKUPS = 10


def translate_sigterm_to_sigint(*args):
    raise KeyboardInterrupt