Java 类ch.qos.logback.classic.spi.LoggerContextVO 实例源码

项目:bartleby    文件:Corpus.java   
static public ILoggingEvent[] make(CorpusModel corpusModel, int n,
    boolean withCallerData) {
  LoggerContextVO lcVO = corpusModel.getRandomlyNamedLoggerContextVO();
  PubLoggingEventVO[] plevoArray = new PubLoggingEventVO[n];
  for (int i = 0; i < n; i++) {
    PubLoggingEventVO e = new PubLoggingEventVO();
    plevoArray[i] = e;
    e.loggerContextVO = lcVO;
    e.timeStamp = corpusModel.getRandomTimeStamp();

    LogStatement logStatement = corpusModel.getRandomLogStatementFromPool();
    e.loggerName = logStatement.loggerName;
    e.level = logStatement.level;
    e.message = logStatement.mat.message;
    e.argumentArray = corpusModel
        .getRandomArgumentArray(logStatement.mat.numberOfArguments);

    if (withCallerData) {
      e.callerDataArray = corpusModel.getRandomCallerData(
          ClassicConstants.DEFAULT_MAX_CALLEDER_DATA_DEPTH, e.loggerName);
    }
    e.throwableProxy = logStatement.throwableProxy;
    e.threadName = corpusModel.getRandomThreadNameFromPool();
  }
  return plevoArray;
}
项目:konker-platform    文件:KonkerLoggerContextVO.java   
public boolean equals(Object o) {
    if(this == o) {
        return true;
    } else if(!(o instanceof LoggerContextVO)) {
        return false;
    } else {
        KonkerLoggerContextVO that = (KonkerLoggerContextVO) o;
        if(this.birthTime != that.birthTime) {
            return false;
        } else {
            if(this.name != null) {
                if(!this.name.equals(that.name)) {
                    return false;
                }
            } else if(that.name != null) {
                return false;
            }

            if(this.propertyMap != null) {
                if(!this.propertyMap.equals(that.propertyMap)) {
                    return false;
                }
            } else if(that.propertyMap != null) {
                return false;
            }

            return true;
        }
    }
}
项目:bartleby    文件:PropertyConverter.java   
public String convert(ILoggingEvent event) {
  if (key == null) {
    return "Property_HAS_NO_KEY";
  } else {
    LoggerContextVO lcvo = event.getLoggerContextVO();
    Map<String, String> map = lcvo.getPropertyMap();
    String val = map.get(key);
    if (val != null) {
      return val;
    } else {
      return System.getProperty(key);
    }
  }
}
项目:bartleby    文件:LoggerContext.java   
public LoggerContext() {
  super();
  this.loggerCache = new ConcurrentHashMap<String, Logger>();

  this.loggerContextRemoteView = new LoggerContextVO(this);
  this.root = new Logger(Logger.ROOT_LOGGER_NAME, null, this);
  this.root.setLevel(Level.DEBUG);
  loggerCache.put(Logger.ROOT_LOGGER_NAME, root);
  initEvaluatorMap();
  size = 1;
  this.frameworkPackages = new ArrayList<String>();
}
项目:armeria    文件:RequestContextExportingAppender.java   
LoggingEventWrapper(ILoggingEvent event, Map<String, String> mdcPropertyMap) {
    this.event = event;
    this.mdcPropertyMap = mdcPropertyMap;

    final LoggerContextVO oldVo = event.getLoggerContextVO();
    if (oldVo != null) {
        vo = new LoggerContextVO(oldVo.getName(), mdcPropertyMap, oldVo.getBirthTime());
    } else {
        vo = null;
    }
}
项目:logback-colorizer    文件:TestLogColorizer.java   
private void setLogbackProperty(
        final ILoggingEvent mockEvent,
        final String propertyKey,
        final String propertyValue) {
    LoggerContextVO mockContext = mock(LoggerContextVO.class);
    Map<String, String> mockPropertiesMap = new HashMap<String, String>();
    mockPropertiesMap.put(propertyKey, propertyValue);
    when(mockEvent.getLoggerContextVO()).thenReturn(mockContext);
    when(mockContext.getPropertyMap()).thenReturn(mockPropertiesMap);
}
项目:centraldogma    文件:ExpectedExceptionAppender.java   
@Override
public LoggerContextVO getLoggerContextVO() {
    return event.getLoggerContextVO();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:LevelRemappingAppender.java   
@Override
public LoggerContextVO getLoggerContextVO() {
    return this.event.getLoggerContextVO();
}
项目:spring-boot-concourse    文件:LevelRemappingAppender.java   
@Override
public LoggerContextVO getLoggerContextVO() {
    return this.event.getLoggerContextVO();
}
项目:jahhan    文件:JahhanLoggingEvent.java   
@Override
public LoggerContextVO getLoggerContextVO() {
    return loggingEvent.getLoggerContextVO();
}
项目:bartleby    文件:LoggerContext.java   
public LoggerContextVO getLoggerContextRemoteView() {
  return loggerContextRemoteView;
}
项目:bartleby    文件:CorpusModel.java   
LoggerContextVO getRandomlyNamedLoggerContextVO() {
  LoggerContext lc = new LoggerContext();
  lc.setName(getRandomJavaIdentifier());
  return new LoggerContextVO(lc);
}
项目:contestparser    文件:LevelRemappingAppender.java   
@Override
public LoggerContextVO getLoggerContextVO() {
    return this.event.getLoggerContextVO();
}
项目:baleen    文件:LoggingServletTest.java   
private ILoggingEvent createEvent(String message) {
    return new ILoggingEvent() {

        @Override
        public void prepareForDeferredProcessing() {
            // Do nothing
        }

        @Override
        public boolean hasCallerData() {
            return false;
        }

        @Override
        public long getTimeStamp() {
            return 0;
        }

        @Override
        public IThrowableProxy getThrowableProxy() {
            return null;
        }

        @Override
        public String getThreadName() {
            return "test";
        }

        @Override
        public String getMessage() {
            return message;
        }

        @Override
        public Map<String, String> getMdc() {
            return Collections.emptyMap();
        }

        @Override
        public Marker getMarker() {
            return null;
        }

        @Override
        public Map<String, String> getMDCPropertyMap() {
            return Collections.emptyMap();
        }

        @Override
        public String getLoggerName() {
            return "fake";
        }

        @Override
        public LoggerContextVO getLoggerContextVO() {
            return null;
        }

        @Override
        public Level getLevel() {
            return Level.INFO;
        }

        @Override
        public String getFormattedMessage() {
            return message;
        }

        @Override
        public StackTraceElement[] getCallerData() {
            return new StackTraceElement[0];
        }

        @Override
        public Object[] getArgumentArray() {
            return new Object[0];
        }
    };
}
项目:skinny-logback    文件:LevelRemappingAppender.java   
@Override
public LoggerContextVO getLoggerContextVO() {
    return this.event.getLoggerContextVO();
}
项目:java-mqlight    文件:MockILoggingEvent.java   
@Override
public LoggerContextVO getLoggerContextVO() {
  return null;
}
项目:armeria    文件:RequestContextExportingAppender.java   
@Override
public LoggerContextVO getLoggerContextVO() {
    return vo;
}
项目:bugsnag-logback    文件:MockLoggingEvent.java   
public MockLoggingEvent with(final LoggerContextVO loggerContextVO) {
    this.loggerContextVO = loggerContextVO;
    return this;
}
项目:bugsnag-logback    文件:MockLoggingEvent.java   
@Override
public LoggerContextVO getLoggerContextVO() {
    return loggerContextVO;
}
项目:logging-extensions    文件:LoggingEventWithLoggerNameInMessage.java   
public LoggerContextVO getLoggerContextVO() {
    return event.getLoggerContextVO();
}
项目:logback-steno    文件:LoggingEventWrapper.java   
@Override
public LoggerContextVO getLoggerContextVO() {
    return _wrappedEvent.getLoggerContextVO();
}
项目:logback-steno    文件:LoggingEventWrapperTest.java   
/**
 * @deprecated Invokes deprecated methods on Logback classes.
 */
@Deprecated
@Test
public void test() {
    final ILoggingEvent wrapped = Mockito.mock(ILoggingEvent.class);
    final LoggerContextVO loggerContext = Mockito.mock(LoggerContextVO.class);
    final IThrowableProxy throwableProxy = Mockito.mock(IThrowableProxy.class);
    final StackTraceElement[] callerData = new StackTraceElement[]{};
    final Marker marker = Mockito.mock(Marker.class);

    // CHECKSTYLE.OFF: IllegalInstantiation - No Guava dependency here.
    final Map<String, String> mdcPropertyMap = new HashMap<>();
    final Map<String, String> mdc = new HashMap<>();
    // CHECKSTYLE.ON: IllegalInstantiation
    mdcPropertyMap.put("foo1", "bar1");
    mdc.put("foo2", "bar2");
    final String message = "The message";
    final Object[] arguments = new Object[] {};

    Mockito.doReturn("threadName").when(wrapped).getThreadName();
    Mockito.doReturn(Level.WARN).when(wrapped).getLevel();
    Mockito.doReturn("loggerName").when(wrapped).getLoggerName();
    Mockito.doReturn(loggerContext).when(wrapped).getLoggerContextVO();
    Mockito.doReturn(throwableProxy).when(wrapped).getThrowableProxy();
    Mockito.doReturn(callerData).when(wrapped).getCallerData();
    Mockito.doReturn(Boolean.TRUE).when(wrapped).hasCallerData();
    Mockito.doReturn(marker).when(wrapped).getMarker();
    Mockito.doReturn(mdcPropertyMap).when(wrapped).getMDCPropertyMap();
    Mockito.doReturn(mdc).when(wrapped).getMdc();
    Mockito.doReturn(1L).when(wrapped).getTimeStamp();

    final LoggingEventWrapper wrapper = new LoggingEventWrapper(wrapped, message, arguments);
    Assert.assertEquals("threadName", wrapper.getThreadName());
    Assert.assertEquals(Level.WARN, wrapper.getLevel());
    Assert.assertEquals("loggerName", wrapper.getLoggerName());
    Assert.assertSame(loggerContext, wrapper.getLoggerContextVO());
    Assert.assertSame(throwableProxy, wrapper.getThrowableProxy());
    Assert.assertSame(callerData, wrapper.getCallerData());
    Assert.assertTrue(wrapper.hasCallerData());
    Assert.assertSame(marker, wrapper.getMarker());
    Assert.assertEquals(mdcPropertyMap, wrapper.getMDCPropertyMap());
    Assert.assertEquals(mdc, wrapper.getMdc());
    Assert.assertEquals(1L, wrapped.getTimeStamp());

    Assert.assertEquals(message, wrapper.getMessage());
    Assert.assertTrue(Arrays.equals(arguments, wrapper.getArgumentArray()));
}
项目:masked-logger    文件:MaskedEvent.java   
@Override
public LoggerContextVO getLoggerContextVO() {
    return baseEvent.getLoggerContextVO();
}
项目:logback-flume-ng    文件:FlumeEvent.java   
@Override
public LoggerContextVO getLoggerContextVO() {
  return event.getLoggerContextVO();
}
项目:bartleby    文件:LoggerContext.java   
/**
 * A new instance of LoggerContextRemoteView needs to be created each time the
 * name or propertyMap (including keys or values) changes.
 */
private void updateLoggerContextVO() {
  loggerContextRemoteView = new LoggerContextVO(this);
}