File indexing completed on 2026-12-02 10:28:12
0001 """
0002 The files under panda_config.logdir that the async log requests may list and read.
0003
0004 They are the logs of the services, whose names start with "panda-", and the standard output and error of the processes
0005 of the services, which their units append to, e.g. panda_daemon_stdout.log and panda_jedi_stderr.log. Each comes with
0006 the files rotated from it, whose names add "-" and the date. The other files there are not, e.g. panda_server_access_log
0007 of httpd, which holds the addresses of the clients.
0008 """
0009
0010 import re
0011
0012
0013 _STD_STREAM_LOG = re.compile(r"panda_[a-z0-9]+_std(?:out|err)\.log(?:-|\Z)")
0014
0015
0016 def is_log_file(file_name: str) -> bool:
0017 """Tell whether a file under the log directory is one the async log requests may list and read."""
0018 return file_name.startswith("panda-") or _STD_STREAM_LOG.match(file_name) is not None