Skip to content

Commit

Permalink
Change default log directory to include point_one directory (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbrannon authored Dec 20, 2023
2 parents 187ed5a + 6dcc067 commit b81a5ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/fusion_engine_client/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@

# Determine the default log base directory in the following order of priority:
# - P1_LOG_BASE_DIR environment variable
# - If Windows, set to `My Documents/logs`
# - If Windows, set to `My Documents/point_one/logs`
# - Otherwise (Linux/Mac):
# - Use `/logs` if it exists
# - Otherwise, use `~/logs`
# - Otherwise, use `~/point_one/logs`
#
# Note that this is the default value. It can still be overridden by setting `log_base_dir` in all functions below
# (typically controlled by a --log-base-dir argument to an application).
DEFAULT_LOG_BASE_DIR = os.getenv('P1_LOG_BASE_DIR')
if DEFAULT_LOG_BASE_DIR is None:
if os.name == "nt":
DEFAULT_LOG_BASE_DIR = os.path.expandvars("%USERPROFILE%/Documents/logs")
DEFAULT_LOG_BASE_DIR = os.path.expandvars("%USERPROFILE%/Documents/point_one/logs")
else:
if os.path.exists('/logs'):
DEFAULT_LOG_BASE_DIR = '/logs'
else:
DEFAULT_LOG_BASE_DIR = os.path.expanduser("~/logs")
DEFAULT_LOG_BASE_DIR = os.path.expanduser("~/point_one/logs")


def find_log_by_pattern(pattern, log_base_dir=DEFAULT_LOG_BASE_DIR, allow_multiple=False,
Expand Down

0 comments on commit b81a5ae

Please sign in to comment.