SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]
Enh: Configuration option to show time in log (#583)
Kilian Lieret747220fc4a56
diff --git a/docs/config/env.md b/docs/config/env.mdindex 059eee44..3eaec810 100644--- a/docs/config/env.md+++ b/docs/config/env.md@@ -8,6 +8,7 @@ This page details all environment variables that are currently in use by SWE-age* All API keys (for LMs and GitHub) can be set as an environment variable. See [here](../installation/keys.md) for more information.* `SWE_AGENT_CONFIG_ROOT`: Used to resolve relative paths in the [config](config.md)+* `SWE_AGENT_LOG_TIME`: Add timestamps to log (**can only be set as an environment variable**)!!! warning "Unstable"The following variables might still be subject to changediff --git a/sweagent/utils/log.py b/sweagent/utils/log.pyindex bc736c4f..1e2a7987 100644--- a/sweagent/utils/log.py+++ b/sweagent/utils/log.py@@ -1,6 +1,7 @@from __future__ import annotationsimport logging+import osfrom rich.logging import RichHandler@@ -12,7 +13,10 @@ def get_logger(name: str) -> logging.Logger:if name in _SET_UP_LOGGERS:# Already set upreturn logger- handler = RichHandler(show_time=False, show_path=False)+ handler = RichHandler(+ show_time=bool(os.environ.get("SWE_AGENT_LOG_TIME", False)),+ show_path=False,+ )handler.setLevel(logging.DEBUG)logger.setLevel(logging.DEBUG)logger.addHandler(handler)