How to use LoggingFlags class of org.openqa.selenium.grid.log package

Best Selenium code snippet using org.openqa.selenium.grid.log.LoggingFlags

Run Selenium automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

copy
1// Licensed to the Software Freedom Conservancy (SFC) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The SFC licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18package org.openqa.selenium.grid.log;
19
20import com.google.auto.service.AutoService;
21
22import com.beust.jcommander.Parameter;
23
24import org.openqa.selenium.grid.config.ConfigValue;
25import org.openqa.selenium.grid.config.HasRoles;
26import org.openqa.selenium.grid.config.Role;
27
28import java.util.Set;
29
30import static org.openqa.selenium.grid.config.StandardGridRoles.ALL_ROLES;
31import static org.openqa.selenium.grid.log.LoggingOptions.DEFAULT_CONFIGURE_LOGGING;
32import static org.openqa.selenium.grid.log.LoggingOptions.DEFAULT_HTTP_LOGS;
33import static org.openqa.selenium.grid.log.LoggingOptions.DEFAULT_LOG_LEVEL;
34import static org.openqa.selenium.grid.log.LoggingOptions.DEFAULT_PLAIN_LOGS;
35import static org.openqa.selenium.grid.log.LoggingOptions.DEFAULT_STRUCTURED_LOGS;
36import static org.openqa.selenium.grid.log.LoggingOptions.DEFAULT_TRACING_ENABLED;
37import static org.openqa.selenium.grid.log.LoggingOptions.LOGGING_SECTION;
38
39@SuppressWarnings("FieldMayBeFinal")
40@AutoService(HasRoles.class)
41public class LoggingFlags implements HasRoles {
42
43  @Parameter(
44    description = "Configure logging",
45    hidden = true,
46    names = "--configure-logging",
47    arity = 1)
48  @ConfigValue(section = LOGGING_SECTION, name = "enable", example = "true")
49  private Boolean configureLogging = DEFAULT_CONFIGURE_LOGGING;
50
51  @Parameter(description = "Use structured logs", names = "--structured-logs", arity = 1)
52  @ConfigValue(section = LOGGING_SECTION, name = "structured-logs", example = "false")
53  private Boolean structuredLogs = DEFAULT_STRUCTURED_LOGS;
54
55  @Parameter(description = "Use plain log lines", names = "--plain-logs", arity = 1)
56  @ConfigValue(section = LOGGING_SECTION, name = "plain-logs", example = "true")
57  private Boolean plainLogs = DEFAULT_PLAIN_LOGS;
58
59  @Parameter(description = "Enable trace collection", hidden = true, names = "--tracing", arity = 1)
60  @ConfigValue(section = LOGGING_SECTION, name = "tracing", example = "true")
61  private Boolean enableTracing = DEFAULT_TRACING_ENABLED;
62
63  @Parameter(description = "Enable http logging. Tracing should be enabled to log http logs.", hidden = true, names = "--http-logs", arity = 1)
64  @ConfigValue(section = LOGGING_SECTION, name = "http-logs", example = "true")
65  private Boolean httpLogs = DEFAULT_HTTP_LOGS;
66
67  @Parameter(description = "File to write out logs", names = "--log", arity = 1)
68  @ConfigValue(section = LOGGING_SECTION, name = "log-file", example = "true")
69  private String logFile;
70
71  @Parameter(description = "Log encoding", names = "--log-encoding", arity = 1)
72  @ConfigValue(section = LOGGING_SECTION, name = "log-encoding", example = "UTF-8")
73  private String logEncoding;
74
75  @Parameter(description =
76    "Log level. Default logging level is INFO. Log levels are described here " +
77    "https://docs.oracle.com/javase/7/docs/api/java/util/logging/Level.html",
78    names = "--log-level", arity = 1)
79  @ConfigValue(section = LOGGING_SECTION, name = "log-level", example = "INFO")
80  private String logLevel = DEFAULT_LOG_LEVEL;
81
82  @Override
83  public Set<Role> getRoles() {
84    return ALL_ROLES;
85  }
86}
87
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

...Most popular Stackoverflow questions on LoggingFlags

    No relevant questions found for this class 😞

Most used methods in LoggingFlags

Run Selenium Automation Tests on LambdaTest Cloud Grid

Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)