Package com.opengamma.util.log

Examples of com.opengamma.util.log.SimpleLogEvent


public class ExecutionLogFudgeBuilderTest {

  @Test
  public void roundTrip() {
    MutableExecutionLog log = new MutableExecutionLog(ExecutionLogMode.FULL);
    LogEvent errorEvent = new SimpleLogEvent(LogLevel.ERROR, "error msg");
    LogEvent infoEvent1 = new SimpleLogEvent(LogLevel.INFO, "info msg");
    LogEvent infoEvent2 = new SimpleLogEvent(LogLevel.INFO, "info msg2");
    log.add(errorEvent);
    log.add(infoEvent1);
    log.add(infoEvent2);
    String execptionMsg = "exception msg";
    assertEquals(log.getLogLevels(), EnumSet.of(LogLevel.ERROR, LogLevel.INFO));
View Full Code Here


        Set<ValueSpecification> missing = jobResultItem.getMissingInputs();
        if (!missing.isEmpty()) {
          if (logCopy == null) {
            logCopy = new MutableExecutionLog(log);
          }
          logCopy.add(new SimpleLogEvent(log.hasException() ? LogLevel.WARN : LogLevel.INFO, toString("Missing input", missing)));
        }
        missing = jobResultItem.getMissingOutputs();
        if (!missing.isEmpty()) {
          if (logCopy == null) {
            logCopy = new MutableExecutionLog(log);
          }
          logCopy.add(new SimpleLogEvent(LogLevel.WARN, toString("Failed to produce output", missing)));
        }
        for (final ValueSpecification inputValueSpec : node.getInputValues()) {
          final DependencyNodeJobExecutionResult nodeResult = jobExecutionResultCache.get(inputValueSpec);
          if (nodeResult == null) {
            // Market data
View Full Code Here

  public void add(LogEvent logEvent) {
    ArgumentChecker.notNull(logEvent, "logEvent");
    LogLevel level = logEvent.getLevel();
    _logLevels.add(level);
    if (_logMode == ExecutionLogMode.FULL) {
      _events.add(new SimpleLogEvent(level, logEvent.getMessage()));
    }
  }
View Full Code Here

    final ComputationTarget target = new ComputationTarget(ComputationTargetType.CURRENCY, Currency.USD);
    final MockFunction fn1 = new MockFunction(MockFunction.UNIQUE_ID + "1", target) {

      @Override
      public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target, final Set<ValueRequirement> desiredValues) {
        LogBridge.getInstance().log(new SimpleLogEvent(LogLevel.WARN, "Warning during execution"));
        LogBridge.getInstance().log(new SimpleLogEvent(LogLevel.ERROR, "Error during execution"));
        return super.execute(executionContext, inputs, target, desiredValues);
      }

    };
    final ValueRequirement requirement1 = new ValueRequirement("value1", target.toSpecification());
    fn1.addResult(new ValueSpecification(requirement1.getValueName(), target.toSpecification(), ValueProperties.with(ValuePropertyNames.FUNCTION, "fn1").get()), "result1");
    functionRepository.addFunction(fn1);

    final MockFunction fn2 = new MockFunction(MockFunction.UNIQUE_ID + "2", target) {

      @Override
      public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target, final Set<ValueRequirement> desiredValues) {
        LogBridge.getInstance().log(new SimpleLogEvent(LogLevel.WARN, "Warning during execution"));
        return super.execute(executionContext, inputs, target, desiredValues);
      }

    };
    fn2.addRequirement(requirement1);
View Full Code Here

      super(uniqueId, target);
    }

    @Override
    public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target, final Set<ValueRequirement> desiredValues) {
      final LogEvent logEvent = new SimpleLogEvent(LogLevel.WARN, "Warning during execution");
      LogBridge.getInstance().log(logEvent);
      return super.execute(executionContext, inputs, target, desiredValues);
    }
View Full Code Here

TOP

Related Classes of com.opengamma.util.log.SimpleLogEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.