Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Mar 4, 2024
1 parent df7c7c5 commit 99ccca7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ static public Scope stringToScope(String scopeStr) {
return Scope.LOCAL;
}

// static public void setProperty(SaxEventInterpretationContext ic, String key, String value, Scope scope) {
// switch (scope) {
// case LOCAL:
// ic.addSubstitutionProperty(key, value);
// break;
// case CONTEXT:
// ic.getContext().putProperty(key, value);
// break;
// case SYSTEM:
// OptionHelper.setSystemProperty(ic, key, value);
// }
// }

static public void setProperty(ContextAwarePropertyContainer ic, String key, String value, Scope scope) {
switch (scope) {
Expand All @@ -63,23 +51,4 @@ static public void setProperty(ContextAwarePropertyContainer ic, String key, Str
OptionHelper.setSystemProperty(ic, key, value);
}
}

// /**
// * Add all the properties found in the argument named 'props' to an
// * InterpretationContext.
// */
// static public void setProperties(SaxEventInterpretationContext ic, Properties props, Scope scope) {
// switch (scope) {
// case LOCAL:
// ic.addSubstitutionProperties(props);
// break;
// case CONTEXT:
// ContextUtil cu = new ContextUtil(ic.getContext());
// cu.addProperties(props);
// break;
// case SYSTEM:
// OptionHelper.setSystemProperties(ic, props);
// }
// }

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
*/
package ch.qos.logback.core.model;

import ch.qos.logback.core.joran.action.ActionUtil.Scope;
import ch.qos.logback.core.model.processor.ModelInterpretationContext;
import ch.qos.logback.core.model.util.PropertyModelHandlerHelper;

import java.util.Properties;

public class ModelUtil {


Expand All @@ -22,4 +28,28 @@ static public void resetForReuse(Model model) {
model.resetForReuse();
}



/**
* Add all the properties found in the argument named 'props' to an
* ModelInterpretationContext.
*
* @deprecated moved to {@link PropertyModelHandlerHelper#setProperty}
*/
@Deprecated
static public void setProperty(ModelInterpretationContext mic, String key, String value, Scope scope) {
PropertyModelHandlerHelper.setProperty(mic, key, value, scope);
}

/**
* Add all the properties found in the argument named 'props' to an
* ModelInterpretationContext.
*
* @deprecated moved to {@link PropertyModelHandlerHelper#setProperties}
*/
@Deprecated
static public void setProperties(ModelInterpretationContext mic, Properties props, Scope scope) {
PropertyModelHandlerHelper.setProperties(mic, props, scope);
}

}

0 comments on commit 99ccca7

Please sign in to comment.