We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e36608 commit e7cab80Copy full SHA for e7cab80
1 file changed
agentstack/log.py
@@ -162,8 +162,13 @@ def _build_logger() -> logging.Logger:
162
163
try:
164
# `conf.PATH` can change during startup, so defer building the path
165
- # log file only gets written to if it exists, which happens on project init
166
log_filename = conf.PATH / LOG_FILENAME
+
167
+ # log file only gets written to if it exists, which happens on project init
168
+ # this prevents us from littering log files outside of project directories
169
+ if not log_filename.exists():
170
+ raise FileNotFoundError
171
172
file_handler = logging.FileHandler(log_filename)
173
file_handler.setFormatter(FileFormatter())
174
file_handler.setLevel(DEBUG)
0 commit comments