java.lang.Object
com.qaitsolutions.pframe.core.logging.Log

public final class Log extends Object
Framework central log that incorporates extent logging, console logging, log4j logging.

Since:
1.0
Author:
Iulian Andrei (iulian.andrei@qaitsolutions.com)
  • Constructor Details

    • Log

      public Log()
  • Method Details

    • info

      public static void info(@NonNull @NonNull String message)
      Logs info level messages. Info level will be sent to:
      • FILE
      • CONSOLE
      • REPORT
      Parameters:
      message - Message that will be printed in the log.
      Since:
      1.0
    • info

      public static void info(@NonNull @NonNull String message, Object... args)
      Convenience method for info(String) with added String.format(String, Object...) functionality.

      Parameters:
      message - Message that will be printed in the log.
      args - Arguments referenced by the format specifiers in the format string.
      Since:
      1.0
    • warn

      public static void warn(@NonNull @NonNull String message)
      Logs warning level messages. Warning level will be sent to:
      • FILE
      • CONSOLE
      • REPORT
      Parameters:
      message - Message that will be printed in the log.
      Since:
      1.0
    • warn

      public static void warn(@NonNull @NonNull String message, Object... args)
      Convenience method for warn(String) with added String.format(String, Object...) functionality.

      Parameters:
      message - Message that will be printed in the log.
      args - Arguments referenced by the format specifiers in the format string.
      Since:
      1.0
    • warn

      public static void warn(@NonNull @NonNull String message, @NonNull @NonNull Throwable e)
      Logs warning level messages. Same functionality as warn(String), but with the throwable full stacktrace being logged in the log file.

      Parameters:
      message - Message that will be printed in the log.
      e - Exception to be logged in log file.
      Since:
      1.0
    • fail

      public static void fail(@NonNull @NonNull String message)
      Logs fail level messages. Fail level will be sent to:
      • FILE
      • CONSOLE
      • REPORT

      In the file log the log level is error.

      Parameters:
      message - Message that will be printed in the log.
      Since:
      1.0
    • fail

      public static void fail(@NonNull @NonNull String message, Object... args)
      Convenience method for fail(String) with added String.format(String, Object...) functionality.

      Parameters:
      message - Message that will be printed in the log.
      args - Arguments referenced by the format specifiers in the format string.
      Since:
      1.0
    • fail

      public static void fail(@NonNull @NonNull String message, Throwable e)
      Logs fail level messages. Same functionality as fail(String), but with the throwable full stacktrace being logged in the log file.

      Parameters:
      message - Message that will be printed in the log.
      e - Exception to be logged in log file.
      Since:
      1.0
    • pass

      public static void pass(@NonNull @NonNull String message)
      Logs pass level messages. Pass level will be sent to:
      • FILE
      • CONSOLE
      • REPORT

      In the file log the log level is info.

      Parameters:
      message - Message that will be printed in the log.
      Since:
      1.0
    • pass

      public static void pass(@NonNull @NonNull String message, Object... args)
      Convenience method for pass(String) with added String.format(String, Object...) functionality.

      Parameters:
      message - Message that will be printed in the log.
      args - Arguments referenced by the format specifiers in the format string.
      Since:
      1.0
    • skip

      public static void skip(@NonNull @NonNull String message)
      Logs skip level messages. Skip level will be sent to:
      • FILE
      • CONSOLE
      • REPORT

      In the file log the log level is warn.

      Parameters:
      message - Message that will be printed in the log.
      Since:
      1.0
    • skip

      public static void skip(@NonNull @NonNull String message, Object... args)
      Convenience method for skip(String) with added String.format(String, Object...) functionality.

      Parameters:
      message - Message that will be printed in the log.
      args - Arguments referenced by the format specifiers in the format string.
      Since:
      1.0
    • debug

      public static void debug(@NonNull @NonNull String message)
      Logs debug level messages. Debug level will be sent to:
      • FILE
      • CONSOLE
      Parameters:
      message - Message that will be printed in the log.
      Since:
      1.0
    • debug

      public static void debug(@NonNull @NonNull String message, Object... args)
      Convenience method for debug(String) with added String.format(String, Object...) functionality.

      Parameters:
      message - Message that will be printed in the log.
      args - Arguments referenced by the format specifiers in the format string.
      Since:
      1.0
    • infoWithScreenshotByPath

      public static void infoWithScreenshotByPath(@NonNull @NonNull String message, @NonNull @NonNull String path)
      Logs info level messages with a screenshot attached to the report. This will long in:
      • REPORT
      Parameters:
      message - Message that will be printed in the report.
      path - Path and filename of the screenshot (e.g. target/report/screenshots/scr.jpg).
      Since:
      1.0
    • infoWithScreenshotByBase64String

      public static void infoWithScreenshotByBase64String(@NonNull @NonNull String message, @NonNull @NonNull String base64)
      Logs info level messages with a screenshot attached by base64 string. This will long in:
      • REPORT
      Parameters:
      message - Message that will be printed in the report.
      base64 - String image in base64 encoding.
      Since:
      1.0
    • infoWithJson

      public static void infoWithJson(@NonNull @NonNull String json)
      Logs info level messages with a json codeblock. This will long in:
      • REPORT
      Parameters:
      json - Json to be printed in the report.
      Since:
      1.0
    • infoWithXml

      public static void infoWithXml(@NonNull @NonNull String xml)
      Logs info level messages with a xml codeblock. This will long in:
      • REPORT
      Parameters:
      xml - XML to be printed in the report.