com.applitools.eyes.Logger.log()方法的使用及代码示例

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

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

Logger.log介绍

[英]Writes a (non-verbose) write message.
[中]写入(非详细的)写入消息。

代码示例

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

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

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

  1. /**
  2. * @param hostApp The application running the AUT (e.g., Chrome).
  3. */
  4. @SuppressWarnings("UnusedDeclaration")
  5. public void setHostApp(String hostApp) {
  6. logger.log("Host App: " + hostApp);
  7. if (hostApp == null || hostApp.isEmpty()) {
  8. this.hostApp = null;
  9. } else {
  10. this.hostApp = hostApp.trim();
  11. }
  12. }

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

  1. /**
  2. * @param hostApp The application running the AUT (e.g., Chrome).
  3. */
  4. @SuppressWarnings("UnusedDeclaration")
  5. public void setHostApp(String hostApp) {
  6. logger.log("Host App: " + hostApp);
  7. if (hostApp == null || hostApp.isEmpty()) {
  8. this.hostApp = null;
  9. } else {
  10. this.hostApp = hostApp.trim();
  11. }
  12. }

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

  1. /**
  2. * @param hostApp The application running the AUT (e.g., Chrome).
  3. */
  4. @SuppressWarnings("UnusedDeclaration")
  5. public void setHostApp(String hostApp) {
  6. logger.log("Host App: " + hostApp);
  7. if (hostApp == null || hostApp.isEmpty()) {
  8. this.hostApp = null;
  9. } else {
  10. this.hostApp = hostApp.trim();
  11. }
  12. }

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

  1. /**
  2. * @param hostOS The host OS running the AUT.
  3. */
  4. @SuppressWarnings("UnusedDeclaration")
  5. public void setHostOS(String hostOS) {
  6. logger.log("Host OS: " + hostOS);
  7. if(hostOS == null || hostOS.isEmpty()) {
  8. this.hostOS = null;
  9. }
  10. else {
  11. this.hostOS = hostOS.trim();
  12. }
  13. }

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

  1. /**
  2. * @param hostOS The host OS running the AUT.
  3. */
  4. @SuppressWarnings("UnusedDeclaration")
  5. public void setHostOS(String hostOS) {
  6. logger.log("Host OS: " + hostOS);
  7. if(hostOS == null || hostOS.isEmpty()) {
  8. this.hostOS = null;
  9. }
  10. else {
  11. this.hostOS = hostOS.trim();
  12. }
  13. }

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

  1. /**
  2. * @param hostOS The host OS running the AUT.
  3. */
  4. @SuppressWarnings("UnusedDeclaration")
  5. public void setHostOS(String hostOS) {
  6. logger.log("Host OS: " + hostOS);
  7. if(hostOS == null || hostOS.isEmpty()) {
  8. this.hostOS = null;
  9. }
  10. else {
  11. this.hostOS = hostOS.trim();
  12. }
  13. }

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

  1. /**
  2. * @param baselineName If specified, determines the baseline to compare
  3. * with and disables automatic baseline inference.
  4. */
  5. @SuppressWarnings("UnusedDeclaration")
  6. public void setBaselineName(String baselineName) {
  7. logger.log("Baseline name: " + baselineName);
  8. if(baselineName == null || baselineName.isEmpty()) {
  9. this.baselineName = null;
  10. }
  11. else {
  12. this.baselineName = baselineName.trim();
  13. }
  14. }

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

  1. /**
  2. * If not {@code null} specifies a name for the environment in which the application under test is running.
  3. *
  4. * @param envName The name of the environment of the baseline.
  5. */
  6. @SuppressWarnings("UnusedDeclaration")
  7. public void setEnvName(String envName) {
  8. logger.log("Environment name: " + envName);
  9. if(envName== null || envName.isEmpty()) {
  10. this.environmentName = null;
  11. }
  12. else {
  13. this.environmentName = envName.trim();
  14. }
  15. }

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

  1. /**
  2. * If not {@code null}, determines the name of the environment of the baseline.
  3. *
  4. * @param baselineEnvName The name of the baseline's environment.
  5. */
  6. @SuppressWarnings("UnusedDeclaration")
  7. public void setBaselineEnvName(String baselineEnvName) {
  8. logger.log("Baseline environment name: " + baselineEnvName);
  9. if(baselineEnvName== null || baselineEnvName.isEmpty()) {
  10. this.baselineEnvName = null;
  11. }
  12. else {
  13. this.baselineEnvName = baselineEnvName.trim();
  14. }
  15. }

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

  1. /**
  2. * If not {@code null} specifies a name for the environment in which the application under test is running.
  3. *
  4. * @param envName The name of the environment of the baseline.
  5. */
  6. @SuppressWarnings("UnusedDeclaration")
  7. public void setEnvName(String envName) {
  8. logger.log("Environment name: " + envName);
  9. if(envName== null || envName.isEmpty()) {
  10. this.environmentName = null;
  11. }
  12. else {
  13. this.environmentName = envName.trim();
  14. }
  15. }

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

  1. /**
  2. * If not {@code null}, determines the name of the environment of the baseline.
  3. *
  4. * @param baselineEnvName The name of the baseline's environment.
  5. */
  6. @SuppressWarnings("UnusedDeclaration")
  7. public void setBaselineEnvName(String baselineEnvName) {
  8. logger.log("Baseline environment name: " + baselineEnvName);
  9. if(baselineEnvName== null || baselineEnvName.isEmpty()) {
  10. this.baselineEnvName = null;
  11. }
  12. else {
  13. this.baselineEnvName = baselineEnvName.trim();
  14. }
  15. }

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

  1. public static void logExceptionStackTrace(Logger logger, Throwable ex) {
  2. ByteArrayOutputStream stream = new ByteArrayOutputStream(2048);
  3. PrintWriter writer = new PrintWriter(stream, true);
  4. ex.printStackTrace(writer);
  5. logger.log(ex.toString());
  6. try {
  7. logger.log(stream.toString("UTF-8"));
  8. writer.close();
  9. stream.close();
  10. } catch (Exception e) {
  11. e.printStackTrace();
  12. }
  13. }

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

  1. public static void logExceptionStackTrace(Logger logger, Exception ex) {
  2. ByteArrayOutputStream stream = new ByteArrayOutputStream(2048);
  3. PrintWriter writer = new PrintWriter(stream, true);
  4. ex.printStackTrace(writer);
  5. logger.log(ex.toString());
  6. try {
  7. logger.log(stream.toString("UTF-8"));
  8. writer.close();
  9. stream.close();
  10. } catch (Exception e) {
  11. e.printStackTrace();
  12. }
  13. }

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

  1. @Override
  2. public void run() {
  3. while (isServiceOn) {
  4. pauseIfNeeded();
  5. runNextTask();
  6. }
  7. if (this.executor != null) {
  8. this.executor.shutdown();
  9. }
  10. logger.log("Service '" + this.getName() + "' is finished");
  11. }

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

  1. @Override
  2. protected String getAUTSessionId() {
  3. try {
  4. if (this.cachedAUTSessionId == null) {
  5. this.cachedAUTSessionId = driver.getRemoteWebDriver().getSessionId().toString();
  6. }
  7. return this.cachedAUTSessionId;
  8. } catch (Exception e) {
  9. logger.log("WARNING: Failed to get AUT session ID! (maybe driver is not available?). Error: "
  10. + e.getMessage());
  11. return "";
  12. }
  13. }

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

  1. public void check(String name, ICheckSettings checkSettings) {
  2. if (getIsDisabled()) {
  3. logger.log(String.format("check('%s', %s): Ignored", name, checkSettings));
  4. return;
  5. }
  6. ArgumentGuard.notNull(checkSettings, "checkSettings");
  7. checkSettings = checkSettings.withName(name);
  8. this.check(checkSettings);
  9. }

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

  1. private void trySwitchToFrames(WebDriver driver, EyesTargetLocator switchTo, FrameChain frames) {
  2. if (EyesSeleniumUtils.isMobileDevice(driver)) {
  3. return;
  4. }
  5. try {
  6. switchTo.frames(frames);
  7. } catch (WebDriverException e) {
  8. logger.log("WARNING: Failed to switch to original frame chain! " + e.getMessage());
  9. }
  10. }

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

  1. private void initDriver(WebDriver driver) {
  2. if (driver instanceof RemoteWebDriver) {
  3. this.driver = new EyesWebDriver(logger, this, (RemoteWebDriver) driver);
  4. } else if (driver instanceof EyesWebDriver) {
  5. this.driver = (EyesWebDriver) driver;
  6. } else {
  7. String errMsg = "Driver is not a RemoteWebDriver (" +
  8. driver.getClass().getName() + ")";
  9. logger.log(errMsg);
  10. throw new EyesException(errMsg);
  11. }
  12. if (EyesSeleniumUtils.isMobileDevice(driver)) {
  13. regionVisibilityStrategyHandler.set(new NopRegionVisibilityStrategy(logger));
  14. }
  15. }

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

  1. /**
  2. * Sets the maximal time (in seconds) a match operation tries to perform
  3. * a match.
  4. *
  5. * @param seconds Total number of seconds to wait for a match.
  6. */
  7. @SuppressWarnings("UnusedDeclaration")
  8. public void setMatchTimeout(int seconds) {
  9. if (getIsDisabled()) {
  10. logger.verbose("Ignored");
  11. return;
  12. }
  13. logger.verbose("setMatchTimeout(" + seconds + ")");
  14. ArgumentGuard.greaterThanOrEqualToZero(seconds, "seconds");
  15. this.matchTimeout = seconds;
  16. logger.log("Match timeout set to " + seconds + " second(s)");
  17. }

相关文章