Skip to content

Instantly share code, notes, and snippets.

View martinschneider's full-sized avatar
🇹🇼

Martin Schneider martinschneider

🇹🇼
View GitHub Profile
7.5 billion people
Let's assume that 10% of them are travelling = 750 million
Staying in hotels 10 nights per year
2.5 people per room
7.5 bn / 2.5 ~ 3 bn nights per year
On average, a hotel has 20 rooms
365 * 20 ~ 7500 stays
3 bn / 7500 = 400.000
private WebDriver logAppInfo(AppiumDriver<? extends WebElement> driver) {
String appPath = driver.getSessionDetail("app").toString();
if (appPath != null) {
LOG.info("Application: {}", applicationInfoService.getAppInfo(appPath));
}
return driver;
}
<pattern>%d{HH:mm:ss.SSS} %C{0}:%M:%L %msg %n</pattern>
private static final Logger LOG = LoggerFactory.getLogger("loggerName");
LOG.info("performing action " + actionName);
private static final Logger LOG = LoggerFactory.getLogger(SomeJavaClass.class);
@CucumberOptions(plugin = "qa.justtestlah.log.CucumberOptionsBuilder")
private WebDriver logDeviceDetails(AppiumDriver<? extends WebElement> driver) {
LOG.info("Testing device: {}, manufacturer: {}, OS version: {}, screen size: {}",
driver.getSessionDetail("deviceName"), driver.getSessionDetail("deviceManufacturer"),
driver.getSessionDetail("platformVersion"), driver.getSessionDetail("deviceScreenSize"));
return driver;
}
<appender name="server" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%msg %n</pattern>
</encoder>
</appender>
<logger name="server" level="info" additivity="false">
<appender-ref ref="server" />
</logger>
package qa.justtestlah.log;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
<!-- $[appInfo} will be replaced with the value of appInfo written to the log context -->
<pattern>${appInfo} %d{HH:mm:ss.SSS} %.-1level %C{0}:%M:%L %msg %n</pattern>