-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[ES-8436] feat: Change Dockerfile base images to Wolfi #1871
Changes from 6 commits
87adff7
88fc6cd
3d6670b
b6482e4
c8f8d41
50646bf
bbdb597
8eb3748
1503825
a741f06
7da5ea5
5f11ce8
0e2ce5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,16 +95,29 @@ def install_default_log_config(): | |
source_path = io.normalize_path(os.path.join(os.path.dirname(__file__), "resources", "logging.json")) | ||
with open(log_config, "w", encoding="UTF-8") as target: | ||
with open(source_path, encoding="UTF-8") as src: | ||
# Ensure we have a trailing path separator as after LOG_PATH there will only be the file name | ||
log_path = os.path.join(paths.logs(), "") | ||
# the logging path might contain backslashes that we need to escape | ||
log_path = io.escape_path(log_path) | ||
Comment on lines
-100
to
-101
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're dropping backlash escaping which was meant to help with Windows judging by #829. But we never officially supported Windows so I'm fine with it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, how did I not see this? I am happy to add this logic back to the code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, on second thought, this would only have been valuable when we were writing the file out to disk for deserialization later. Since we are doing the replacement on the fly, it should still work, even on Windows |
||
contents = src.read().replace("${LOG_PATH}", log_path) | ||
contents = src.read() | ||
target.write(contents) | ||
add_missing_loggers_to_config() | ||
io.ensure_dir(paths.logs()) | ||
|
||
|
||
# pylint: disable=unused-argument | ||
def configure_file_handler(*args, **kwargs) -> logging.Handler: | ||
""" | ||
Configures the WatchedFileHandler supporting expansion of `~` and `${LOG_PATH}` to the user's home and the log path respectively. | ||
""" | ||
filename = kwargs.pop("filename").replace("${LOG_PATH}", paths.logs()) | ||
return logging.handlers.WatchedFileHandler(filename=filename, encoding=kwargs["encoding"], delay=kwargs.get("delay", False)) | ||
|
||
|
||
def configure_profile_file_handler(*args, **kwargs) -> logging.Handler: | ||
""" | ||
Configures the FileHandler supporting expansion of `~` and `${LOG_PATH}` to the user's home and the log path respectively. | ||
""" | ||
filename = kwargs.pop("filename").replace("${LOG_PATH}", paths.logs()) | ||
return logging.FileHandler(filename=filename, encoding=kwargs["encoding"], delay=kwargs.get("delay", False)) | ||
|
||
|
||
def load_configuration(): | ||
""" | ||
Loads the logging configuration. This is a low-level method and usually | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably a good opportunity to define the rule going forward. Will we keep this version aligned with the version of the nightlies (3.11.x), or perhaps we should bump it up all the way to the newest supported version (3.12.x)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I tried 3.12 and it wasn't playing nice, but I could also be remembering something else. I don't mind pinning it to the newest version we support.