com.applitools.eyes.Logger类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中com.applitools.eyes.Logger类的一些代码示例,展示了Logger类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger类的具体详情如下:
包路径:com.applitools.eyes.Logger
类名称:Logger

Logger介绍

[英]Logs trace messages.
[中]记录跟踪消息。

代码示例

代码示例来源:origin: com.applitools/eyes-common-java3

public void setException(Exception exception) {
  logger.verbose("aborting task with exception");
  this.exception = exception;
  this.type = TaskType.ABORT;
}

代码示例来源:origin: com.applitools/eyes-selenium-java3

@Override
protected void setViewportSize(RectangleSize size) {
  logger.log("WARNING setViewportSize() was called in Visual-Grid context");
}

代码示例来源:origin: com.applitools/eyes-connectivity-java4-jersey2x

public RemoteSessionEventHandler(URI serverUrl, String accessKey, int timeout) {
  this(new Logger(), serverUrl, accessKey, timeout);
}

代码示例来源:origin: com.applitools/eyes-common-java3

public void open(IRenderingEyes eyes, RenderingInfo renderingInfo) {
    logger.verbose("enter");
    if (this.renderingInfo == null) {
      this.renderingInfo = renderingInfo;
    }
//        logger.verbose("locking eyesToOpenList");
    synchronized (eyesToOpenList) {
      eyesToOpenList.add(eyes);
    }
//        logger.verbose("releasing eyesToOpenList");
//        logger.verbose("locking allEyes");
    synchronized (allEyes) {
      allEyes.add(eyes);
    }
    logger.verbose("releasing allEyes");
    eyes.setListener(eyesListener);
    logger.log("concurrencyLock.notify()");
  }

代码示例来源:origin: com.applitools/eyes-sdk-java-jersey2x

/**
 * If a test is running, aborts it. Otherwise, does nothing.
 */
public void abortIfNotClosed() {
  try {
    if (isDisabled) {
      logger.verbose("Ignored");
      return;
    }
    isOpen = false;
    lastScreenshot = null;
    clearUserInputs();
    if (null == runningSession) {
      logger.verbose("Closed");
      return;
    }
    logger.verbose("Aborting server session...");
    try {
      // When aborting we do not save the test.
      serverConnector.stopSession(runningSession, true, false);
      logger.log("--- Test aborted.");
    } catch (EyesException ex) {
      logger.log(
          "Failed to abort server session: " + ex.getMessage());
    }
  } finally {
    runningSession = null;
    logger.getLogHandler().close();
  }
}

代码示例来源:origin: com.applitools/eyes-selenium-java3

/**
 * Sets a handler of log messages generated by this API.
 *
 * @param logHandler Handles log messages generated by this API.
 */
@Override
public void setLogHandler(LogHandler logHandler) {
  if (getIsDisabled()) return;
  LogHandler currentLogHandler = logger.getLogHandler();
  this.logger = new Logger();
  this.logger.setLogHandler(new MultiLogHandler(currentLogHandler, logHandler));
  if (currentLogHandler.isOpen() && !logHandler.isOpen()) {
    logHandler.open();
  }
}

代码示例来源:origin: com.applitools/eyes-selenium-java3

private IEyesConnector createEyesConnector(RenderBrowserInfo browserInfo) {
  logger.verbose("creating eyes server connector");
  IEyesConnector eyesConnector = new EyesConnector(browserInfo, renderingGridManager.getRateLimiter());
  eyesConnector.setLogHandler(this.logger.getLogHandler());
  eyesConnector.setProxy(this.proxy);
  eyesConnector.setBatch(batchInfo);
    logger.verbose("initializing rendering info...");
    this.renderingInfo = eyesConnector.getRenderingInfo();

代码示例来源:origin: com.applitools/eyes-sdk-java

/**
 * Sets a handler of log messages generated by this API.
 *
 * @param logHandler Handles log messages generated by this API.
 */
@SuppressWarnings("UnusedDeclaration")
public void setLogHandler(LogHandler logHandler) {
  logger.setLogHandler(logHandler);
}

代码示例来源:origin: com.applitools/eyes-common-java-jersey1_17-sf2_53_1

/**
   * Writes a (non-verbose) write message.
   * @param message The message to log.
   */
  public void log(String message) {
    logHandler.onMessage(false, getPrefix() + message);
  }
}

代码示例来源:origin: com.applitools/eyes-sdk-java-jersey2x

/**
 * @return The currently set log handler.
 */
@SuppressWarnings("UnusedDeclaration")
public LogHandler getLogHandler() {
  return logger.getLogHandler();
}

代码示例来源:origin: com.applitools/eyes-sdk-java

/**
 * If a test is running, aborts it. Otherwise, does nothing.
 */
public void abortIfNotClosed() {
  try {
    if (isDisabled) {
      logger.verbose("Ignored");
      return;
    }
    isOpen = false;
    lastScreenshot = null;
    clearUserInputs();
    if (null == runningSession) {
      logger.verbose("Closed");
      return;
    }
    logger.verbose("Aborting server session...");
    try {
      // When aborting we do not save the test.
      serverConnector.stopSession(runningSession, true, false);
      logger.log("--- Test aborted.");
    } catch (EyesException ex) {
      logger.log(
          "Failed to abort server session: " + ex.getMessage());
    }
  } finally {
    runningSession = null;
    logger.getLogHandler().close();
  }
}

代码示例来源:origin: com.applitools/eyes-sdk-java

/**
 * Sets the maximal time (in seconds) a match operation tries to perform
 * a match.
 *
 * @param seconds Total number of seconds to wait for a match.
 */
@SuppressWarnings("UnusedDeclaration")
public void setMatchTimeout(int seconds) {
  if (getIsDisabled()) {
    logger.verbose("Ignored");
    return;
  }
  logger.verbose("setMatchTimeout(" + seconds + ")");
  ArgumentGuard.greaterThanOrEqualToZero(seconds, "seconds");
  this.matchTimeout = seconds;
  logger.log("Match timeout set to " + seconds + " second(s)");
}

代码示例来源:origin: com.applitools/eyes-sdk-java-jersey2x

/**
 * Sets a handler of log messages generated by this API.
 *
 * @param logHandler Handles log messages generated by this API.
 */
@SuppressWarnings("UnusedDeclaration")
public void setLogHandler(LogHandler logHandler) {
  logger.setLogHandler(logHandler);
}

代码示例来源:origin: com.applitools/eyes-common-java4

/**
   * Writes a (non-verbose) write message.
   * @param message The message to log.
   */
  public void log(String message) {
    logHandler.onMessage(false, "[LOG    ] " + getPrefix() + message);
  }
}

代码示例来源:origin: com.applitools/eyes-sdk-java

/**
 * @return The currently set log handler.
 */
@SuppressWarnings("UnusedDeclaration")
public LogHandler getLogHandler() {
  return logger.getLogHandler();
}

代码示例来源:origin: com.applitools/eyes-sdk-core-java3-jersey2x

/**
 * If a test is running, aborts it. Otherwise, does nothing.
 */
public void abortIfNotClosed() {
  try {
    if (isDisabled) {
      logger.verbose("Ignored");
      return;
    }
    isOpen = false;
    lastScreenshot = null;
    clearUserInputs();
    if (null == runningSession) {
      logger.verbose("Closed");
      return;
    }
    logger.verbose("Aborting server session...");
    try {
      // When aborting we do not save the test.
      serverConnector.stopSession(runningSession, true, false);
      logger.log("--- Test aborted.");
    } catch (EyesException ex) {
      logger.log(
          "Failed to abort server session: " + ex.getMessage());
    }
  } finally {
    runningSession = null;
    logger.getLogHandler().close();
  }
}

代码示例来源:origin: com.applitools/eyes-selenium-java3

@Override
  public void onRenderComplete() {
    logger.verbose("enter");
    Eyes.this.listener.onRenderComplete();
    logger.verbose("exit");
  }
};

代码示例来源:origin: com.applitools/eyes-sdk-core-java3-jersey2x

/**
 * @param hostApp The application running the AUT (e.g., Chrome).
 */
@SuppressWarnings("UnusedDeclaration")
public void setHostApp(String hostApp) {
  logger.log("Host App: " + hostApp);
  if (hostApp == null || hostApp.isEmpty()) {
    this.hostApp = null;
  } else {
    this.hostApp = hostApp.trim();
  }
}

代码示例来源:origin: com.applitools/eyes-sdk-java-jersey2x

/**
 * Sets the maximal time (in seconds) a match operation tries to perform
 * a match.
 *
 * @param seconds Total number of seconds to wait for a match.
 */
@SuppressWarnings("UnusedDeclaration")
public void setMatchTimeout(int seconds) {
  if (getIsDisabled()) {
    logger.verbose("Ignored");
    return;
  }
  logger.verbose("setMatchTimeout(" + seconds + ")");
  ArgumentGuard.greaterThanOrEqualToZero(seconds, "seconds");
  this.matchTimeout = seconds;
  logger.log("Match timeout set to " + seconds + " second(s)");
}

代码示例来源:origin: com.applitools/eyes-connectivity-java4-jboss

public RemoteSessionEventHandler(URI serverUrl, String accessKey) {
  this(new Logger(), serverUrl, accessKey);
}

相关文章