浏览代码

add log level as an argument to create logger

/bug-failed-api-check
Anupam Bhatnagar 5 年前
当前提交
ee67c628
共有 2 个文件被更改,包括 4 次插入7 次删除
  1. 3
      ml-agents/mlagents/logging_util.py
  2. 8
      ml-agents/mlagents/trainers/learn.py

3
ml-agents/mlagents/logging_util.py


import logging
def create_logger(name):
log_level = logging.INFO
def create_logger(name, log_level=logging.INFO):
date_format = "%Y-%m-%d %H:%M:%S"
log_format = "%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] %(message)s"

8
ml-agents/mlagents/trainers/learn.py


except Exception:
print("\n\n\tUnity Technologies\n")
print(get_version_string())
trainer_logger = create_logger("mlagents.trainers")
env_logger = create_logger("mlagents_envs")
trainer_logger = create_logger("mlagents.trainers", log_level=logging.INFO)
env_logger = create_logger("mlagents_envs", log_level=logging.INFO)
trainer_logger.setLevel("INFO")
env_logger.setLevel("INFO")
# disable noisy warnings from tensorflow.
# disable noisy warnings from tensorflow
tf_utils.set_warnings_enabled(False)
trainer_logger.debug("Configuration for this run:")

正在加载...
取消
保存