How to use the rlbot.utils.logging_utils.get_logger function in rlbot

To help you get started, we’ve selected a few rlbot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SaltieRL / Saltie / framework / model / base_model.py View on Github external
def __init__(self):
        self.logger = get_logger(str(type(self).__name__))
github SaltieRL / Saltie / framework / data_generator / base_generator.py View on Github external
def __init__(self):
        self.logger = get_logger(type(self).__name__)
        pass
github SaltieRL / Saltie / framework / input_formatter / base_input_formatter.py View on Github external
def __init__(self):
        self.logger = get_logger(str(type(self).__name__))
github SaltieRL / Saltie / framework / model_holder / base_model_holder.py View on Github external
def __load_model_safely(self):
        try:
            self.model.load(self.get_file_path())
        except Exception as e:
            get_logger(str(type(self).__name__)).warn("Unable to load model: " + str(e))
github RLBot / RLBotPythonExample / run.py View on Github external
import subprocess
import sys

DEFAULT_LOGGER = 'rlbot'

if __name__ == '__main__':

    try:
        from rlbot.utils import public_utils, logging_utils

        logger = logging_utils.get_logger(DEFAULT_LOGGER)
        if not public_utils.have_internet():
            logger.log(logging_utils.logging_level,
                       'Skipping upgrade check for now since it looks like you have no internet')
        elif public_utils.is_safe_to_upgrade():
            subprocess.call([sys.executable, "-m", "pip", "install", '-r', 'requirements.txt', '--upgrade', '--upgrade-strategy=eager'])

            # https://stackoverflow.com/a/44401013
            rlbots = [module for module in sys.modules if module.startswith('rlbot')]
            for rlbot_module in rlbots:
                sys.modules.pop(rlbot_module)

    except ImportError:
        subprocess.call([sys.executable, "-m", "pip", "install", '-r', 'requirements.txt', '--upgrade', '--upgrade-strategy=eager'])

    try:
        if len(sys.argv) > 1 and sys.argv[1] == 'gui':
github SaltieRL / Saltie / swarm-trainer_hytak / torch_manager.py View on Github external
def __init__(self, agent_metadata_queue, quit_event):
        super().__init__(agent_metadata_queue, quit_event)

        from multiprocessing.managers import BaseManager
        from leviathan.torch_memory import RewardMemory
        BaseManager.register('Memory', RewardMemory)

        self.logger = get_logger('torch_mgr')
        self.metadata_list = [None, None]
        self.manager = BaseManager()
        self.manager.start()
        self.game_memory = self.manager.Memory()
        self.writer = SummaryWriter()
        self.n_iter = 0

        if load_exp:
            self.game_memory.load(name + '.exp')

        from leviathan.torch_model import SymmetricModel, RewardModel
        self.actor_model = SymmetricModel()

        import torch
        if load_model:
            self.actor_model.load_state_dict(torch.load(name + '.actor'))
github SaltieRL / Saltie / agents / swarm / swarm_agent.py View on Github external
def __init__(self, name, team, index):
        super().__init__(name, team, index)
        self.logger = get_logger(name)
        self.manager_path = None
        sys.path.insert(0, get_repo_directory())  # this is for separate process imports
github SaltieRL / Saltie / agents / main_agent / base_model_agent.py View on Github external
def __init__(self, name, team, index):
        super().__init__(name, team, index)
        self.logger = get_logger(name)
        path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
        sys.path.append(path)
github SaltieRL / Saltie / framework / output_formatter / base_output_formatter.py View on Github external
def __init__(self):
        self.logger = get_logger(str(type(self).__name__))