Skip to content

Commit bcc783e

Browse files
committed
Put home dir directly into default env var param
1 parent 26e6585 commit bcc783e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/super_gradients/common/auto_logging/console_logging.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def __init__(self):
118118
@multi_process_safe
119119
def _setup(self):
120120
"""On instantiation, setup the default sink file."""
121-
filename = Path(env_variables.SUPER_GRADIENTS_LOG_DIR).expanduser() / "console.log"
121+
filename = Path(env_variables.SUPER_GRADIENTS_LOG_DIR) / "console.log"
122122
filename.parent.mkdir(exist_ok=True)
123123
self.filename = str(filename)
124124
os.makedirs(os.path.dirname(self.filename), exist_ok=True)

src/super_gradients/common/environment/env_variables.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from pathlib import Path
23
from typing import Optional
34

45

@@ -47,7 +48,7 @@ def HYDRA_FULL_ERROR(self, value: str):
4748

4849
@property
4950
def SUPER_GRADIENTS_LOG_DIR(self) -> str:
50-
return os.getenv("SUPER_GRADIENTS_LOG_DIR", default="~/sg_logs")
51+
return os.getenv("SUPER_GRADIENTS_LOG_DIR", default=f"{Path.home()}/sg_logs")
5152

5253

5354
env_variables = EnvironmentVariables()

0 commit comments

Comments
 (0)