Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default log directory to include point_one directory #289

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading