Class Log
java.lang.Object
com.qaitsolutions.pframe.core.logging.Log
Framework central log that incorporates extent logging, console logging, log4j logging.
- Since:
- 1.0
- Author:
- Iulian Andrei (iulian.andrei@qaitsolutions.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Logs debug level messages.static void
Convenience method fordebug(String)
with addedString.format(String, Object...)
functionality.static void
Logs fail level messages.static void
Convenience method forfail(String)
with addedString.format(String, Object...)
functionality.static void
Logs fail level messages.static void
Logs info level messages.static void
Convenience method forinfo(String)
with addedString.format(String, Object...)
functionality.static void
infoWithJson
(@NonNull String json) Logs info level messages with a json codeblock.static void
infoWithScreenshotByBase64String
(@NonNull String message, @NonNull String base64) Logs info level messages with a screenshot attached by base64 string.static void
infoWithScreenshotByPath
(@NonNull String message, @NonNull String path) Logs info level messages with a screenshot attached to the report.static void
infoWithXml
(@NonNull String xml) Logs info level messages with a xml codeblock.static void
Logs pass level messages.static void
Convenience method forpass(String)
with addedString.format(String, Object...)
functionality.static void
Logs skip level messages.static void
Convenience method forskip(String)
with addedString.format(String, Object...)
functionality.static void
Logs warning level messages.static void
Logs warning level messages.static void
Convenience method forwarn(String)
with addedString.format(String, Object...)
functionality.
-
Constructor Details
-
Log
public Log()
-
-
Method Details
-
info
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
Convenience method forinfo(String)
with addedString.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
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
Convenience method forwarn(String)
with addedString.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
Logs warning level messages. Same functionality aswarn(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
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
Convenience method forfail(String)
with addedString.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
Logs fail level messages. Same functionality asfail(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
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
Convenience method forpass(String)
with addedString.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
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
Convenience method forskip(String)
with addedString.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
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
Convenience method fordebug(String)
with addedString.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
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
Logs info level messages with a xml codeblock. This will long in:- REPORT
- Parameters:
xml
- XML to be printed in the report.
-