# Path: hoplite/utils/server_logging.py
# def add_remote_function_logging_handlers(function_namespace, timestamp, filename=None):
#     logger = logging.getLogger()
# 
#     # If this function has already been called in this process
#     if len(logger.handlers) >= 2:
#         return
# 
#     # This function gets called twice for each remote function call. On the
#     # first call, filename is not provided. On the second call, the filename
#     # from last time is passed in so the same log filename is used.
#     if filename is None:
#         full_log_name = get_log_filename(function_namespace, timestamp)
#     else:
#         full_log_name = filename
# 
#     logger.setLevel(logging.DEBUG)
# 
#     hoplite_remote_enabler_fh = logging.FileHandler(full_log_name)
#     hoplite_remote_enabler_fh.setLevel(logging.DEBUG)
#     hoplite_remote_enabler_fh.setFormatter(get_formatter_verbose())
# 
#     hoplite_remote_enabler_sh = logging.StreamHandler()
#     hoplite_remote_enabler_sh.setLevel(logging.INFO)
#     hoplite_remote_enabler_sh.setFormatter(get_formatter_limited())
# 
#     logger.addHandler(hoplite_remote_enabler_fh)
#     logger.addHandler(hoplite_remote_enabler_sh)
# 
#     return full_log_name


import logging
import pickle
import time
import traceback
from hoplite.utils.server_logging import add_remote_function_logging_handlers
        'Keyword arguments for function call': str(kwargs)
    })
    status.update(status.status)
    try:
        # Attempt to get namespaced class name for use in creating log
        # hierarchy
        try:
            class_name = str(self.__class__)
            if class_name.startswith("<class '"):
                class_name = class_name[8:]
            if class_name.endswith("'>"):
                class_name = class_name[:len(class_name) - 2]
        except Exception:
            class_name = str(self.__class__.__name__)
        timestamp = time.strftime('%Y-%m-%d %H-%M-%S')
        log_filename = add_remote_function_logging_handlers(
            class_name + '.' + function_name, timestamp)
        hoplite_logger.info(
            'Beginning execution of {} with args: {} and kwargs: {}'.format(
                function_name, args, kwargs))
        # Run function
        return_values = getattr(self, function_name)(*args, **kwargs)
        # Remove and re-add handlers because the function could have messed
        # with the root logger
        all_handlers = list(hoplite_logger.handlers)
        for handler in all_handlers:
            handler.close()
            hoplite_logger.removeHandler(handler)
        # We need to pass in log filename this time so that a new file isn't
        # created

# Path: hoplite/utils/server_logging.py
# def add_remote_function_logging_handlers(function_namespace, timestamp, filename=None):
#     logger = logging.getLogger()
# 
#     # If this function has already been called in this process
#     if len(logger.handlers) >= 2:
#         return
# 
#     # This function gets called twice for each remote function call. On the
#     # first call, filename is not provided. On the second call, the filename
#     # from last time is passed in so the same log filename is used.
#     if filename is None:
#         full_log_name = get_log_filename(function_namespace, timestamp)
#     else:
#         full_log_name = filename
# 
#     logger.setLevel(logging.DEBUG)
# 
#     hoplite_remote_enabler_fh = logging.FileHandler(full_log_name)
#     hoplite_remote_enabler_fh.setLevel(logging.DEBUG)
#     hoplite_remote_enabler_fh.setFormatter(get_formatter_verbose())
# 
#     hoplite_remote_enabler_sh = logging.StreamHandler()
#     hoplite_remote_enabler_sh.setLevel(logging.INFO)
#     hoplite_remote_enabler_sh.setFormatter(get_formatter_limited())
# 
#     logger.addHandler(hoplite_remote_enabler_fh)
#     logger.addHandler(hoplite_remote_enabler_sh)
# 
#     return full_log_name


# Path: hoplite/builtin_plugins/remote_enabler_job.py
import logging
import pickle
import time
import traceback
from hoplite.utils.server_logging import add_remote_function_logging_handlers

        'Keyword arguments for function call': str(kwargs)
    })
    status.update(status.status)
    try:
        # Attempt to get namespaced class name for use in creating log
        # hierarchy
        try:
            class_name = str(self.__class__)
            if class_name.startswith("<class '"):
                class_name = class_name[8:]
            if class_name.endswith("'>"):
                class_name = class_name[:len(class_name) - 2]
        except Exception:
            class_name = str(self.__class__.__name__)
        timestamp = time.strftime('%Y-%m-%d %H-%M-%S')
        log_filename = add_remote_function_logging_handlers(
            class_name + '.' + function_name, timestamp)
        hoplite_logger.info(
            'Beginning execution of {} with args: {} and kwargs: {}'.format(
                function_name, args, kwargs))
        # Run function
        return_values = getattr(self, function_name)(*args, **kwargs)
        # Remove and re-add handlers because the function could have messed
        # with the root logger
        all_handlers = list(hoplite_logger.handlers)
        for handler in all_handlers:
            handler.close()
            hoplite_logger.removeHandler(handler)
        # We need to pass in log filename this time so that a new file isn't
        # created

        add_remote_function_logging_handlers(