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

refactor YamlAppenderSwapper #33011

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ public final class YamlAppenderSwapper implements YamlConfigurationSwapper<YamlA

@Override
public YamlAppenderConfiguration swapToYamlConfiguration(final ShardingSphereAppender data) {
if (null == data) {
return null;
}
YamlAppenderConfiguration result = new YamlAppenderConfiguration();
result.setAppenderName(data.getAppenderName());
result.setAppenderClass(data.getAppenderClass());
Expand All @@ -41,9 +38,6 @@ public YamlAppenderConfiguration swapToYamlConfiguration(final ShardingSphereApp

@Override
public ShardingSphereAppender swapToObject(final YamlAppenderConfiguration yamlConfig) {
if (null == yamlConfig) {
return null;
}
ShardingSphereAppender result = new ShardingSphereAppender(yamlConfig.getAppenderName(), yamlConfig.getAppenderClass(), yamlConfig.getPattern());
result.setFile(yamlConfig.getFile());
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ public final class YamlLoggerSwapper implements YamlConfigurationSwapper<YamlLog

@Override
public YamlLoggerConfiguration swapToYamlConfiguration(final ShardingSphereLogger data) {
if (null == data) {
return null;
}
YamlLoggerConfiguration result = new YamlLoggerConfiguration();
result.setLoggerName(data.getLoggerName());
result.setLevel(data.getLevel());
Expand All @@ -42,9 +39,6 @@ public YamlLoggerConfiguration swapToYamlConfiguration(final ShardingSphereLogge

@Override
public ShardingSphereLogger swapToObject(final YamlLoggerConfiguration yamlConfig) {
if (null == yamlConfig) {
return null;
}
ShardingSphereLogger result = new ShardingSphereLogger(yamlConfig.getLoggerName(), yamlConfig.getLevel(), yamlConfig.getAdditivity(), yamlConfig.getAppenderName());
result.setProps(yamlConfig.getProps());
return result;
Expand Down