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

SDK新增滚动日志功能 #706

Merged
merged 6 commits into from
Jan 2, 2025

Conversation

C9luster
Copy link
Contributor

@C9luster C9luster commented Jan 2, 2025

完成SDK新增滚动日志功能,依据如下参数滚动:
(1)依据时间滚动
(2)依据文件大小滚动
(3)限制存留文件数量
(4)依据总文件的大小滚动
新增能力:
(1)分离DEBUG级别日志和ERROR级别日志,ERROR日志会独立输出到error开头的文件,此更改同步覆盖到原有的环境变量、setFilename功能中
注意:
(1)文件大小级别日志后缀为与时间滚动相同的时间戳

ERROR_SET_CONFIG_HEADER = {
'level': 'ERROR',
'formatter': 'standard',
'class': 'appbuilder.SizeAndTimeRotatingFileHandler',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个参数名改成和现有的一致。

LOGGING_CONFIG["handlers"]["file"]["filename"] = log_file
ERROR_FILE_HEADER["filename"] = _add_error_to_file_name(log_file)
FILE_HEADER["filename"] = log_file
FILE_HEADER["level"] = loglevel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这几个loglevel,改成loglevel.upper()

self.base_filename = filename
self.when = when.upper()
self.interval = interval
self.max_bytes = max_bytes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参数名改成一致的。

Copy link
Contributor

@userpj userpj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@userpj userpj force-pushed the new-new-new-update-sdk-log branch from ae5d0d3 to 88fbb8f Compare January 2, 2025 13:01
@C9luster C9luster closed this Jan 2, 2025
@C9luster C9luster reopened this Jan 2, 2025
@userpj userpj force-pushed the new-new-new-update-sdk-log branch from 88fbb8f to 4868155 Compare January 2, 2025 13:05
@C9luster C9luster closed this Jan 2, 2025
@C9luster C9luster reopened this Jan 2, 2025
@userpj userpj force-pushed the new-new-new-update-sdk-log branch from 4868155 to 65756e8 Compare January 2, 2025 13:20
@C9luster C9luster closed this Jan 2, 2025
@C9luster C9luster reopened this Jan 2, 2025
@userpj userpj force-pushed the new-new-new-update-sdk-log branch from 65756e8 to d41647d Compare January 2, 2025 13:23
@C9luster C9luster closed this Jan 2, 2025
@C9luster C9luster reopened this Jan 2, 2025
Copy link
Collaborator

@MrChengmo MrChengmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MrChengmo MrChengmo merged commit 90585ac into baidubce:master Jan 2, 2025
6 of 10 checks passed
@C9luster C9luster deleted the new-new-new-update-sdk-log branch January 7, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants