Spaces:
Sleeping
Sleeping
Refactor file permission handling in check_create_paths and ensure consistent logging setup
Browse files- file_handler/file_utils.py +1 -1
- utils/logger.py +1 -1
file_handler/file_utils.py
CHANGED
|
@@ -35,7 +35,7 @@ def check_create_paths(file_dir: Union[str, Path]) -> List[Path]:
|
|
| 35 |
if not file_dir.exists():
|
| 36 |
##SMY: [resolved] Permission Errno13 - https://stackoverflow.com/a/57454275
|
| 37 |
file_dir.mkdir(mode=0o2644, parents=True, exist_ok=True) ##SMY: create nested path if not exists
|
| 38 |
-
file_dir.chmod(0)
|
| 39 |
|
| 40 |
return file_dir
|
| 41 |
|
|
|
|
| 35 |
if not file_dir.exists():
|
| 36 |
##SMY: [resolved] Permission Errno13 - https://stackoverflow.com/a/57454275
|
| 37 |
file_dir.mkdir(mode=0o2644, parents=True, exist_ok=True) ##SMY: create nested path if not exists
|
| 38 |
+
file_dir.chmod(0)
|
| 39 |
|
| 40 |
return file_dir
|
| 41 |
|
utils/logger.py
CHANGED
|
@@ -67,7 +67,7 @@ def setup_logging(level: int = None) -> None:
|
|
| 67 |
#file_handler = logging.FileHandler("logs/app_logging.log", mode="a", encoding="utf-8")
|
| 68 |
from file_handler.file_utils import check_create_paths
|
| 69 |
file_handler = logging.FileHandler(check_create_paths("app_logging.log", mode="a", encoding="utf-8"))
|
| 70 |
-
file_handler.setFormatter(JsonFormatter())
|
| 71 |
|
| 72 |
root = logging.getLogger()
|
| 73 |
root.handlers.clear()
|
|
|
|
| 67 |
#file_handler = logging.FileHandler("logs/app_logging.log", mode="a", encoding="utf-8")
|
| 68 |
from file_handler.file_utils import check_create_paths
|
| 69 |
file_handler = logging.FileHandler(check_create_paths("app_logging.log", mode="a", encoding="utf-8"))
|
| 70 |
+
file_handler.setFormatter(JsonFormatter())
|
| 71 |
|
| 72 |
root = logging.getLogger()
|
| 73 |
root.handlers.clear()
|