This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 5152ae28cb Code clean-up - formatting. No functional change.
5152ae28cb is described below
commit 5152ae28cb68b3ea9382072acdfe9876c592c009
Author: Mark Thomas <[email protected]>
AuthorDate: Thu May 22 17:20:57 2025 +0100
Code clean-up - formatting. No functional change.
---
.../apache/tomcat/util/log/SystemLogHandler.java | 12 +++----
.../org/apache/tomcat/util/log/UserDataHelper.java | 38 +++++++++-------------
2 files changed, 21 insertions(+), 29 deletions(-)
diff --git a/java/org/apache/tomcat/util/log/SystemLogHandler.java
b/java/org/apache/tomcat/util/log/SystemLogHandler.java
index dd5fceab15..a6b7c85c9a 100644
--- a/java/org/apache/tomcat/util/log/SystemLogHandler.java
+++ b/java/org/apache/tomcat/util/log/SystemLogHandler.java
@@ -25,10 +25,8 @@ import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
/**
- * This helper class may be used to do sophisticated redirection of
- * System.out and System.err on a per Thread basis.
- * A stack is implemented per Thread so that nested startCapture
- * and stopCapture can be used.
+ * This helper class may be used to do sophisticated redirection of System.out
and System.err on a per Thread basis. A
+ * stack is implemented per Thread so that nested startCapture and stopCapture
can be used.
*
* @author Remy Maucherat
* @author Glenn L. Nielsen
@@ -123,6 +121,7 @@ public class SystemLogHandler extends PrintStream {
/**
* Find PrintStream to which the output must be written to.
+ *
* @return the print stream
*/
protected PrintStream findStream() {
@@ -160,7 +159,7 @@ public class SystemLogHandler extends PrintStream {
@Override
protected void setError() {
- //findStream().setError();
+ // findStream().setError();
}
@Override
@@ -169,8 +168,7 @@ public class SystemLogHandler extends PrintStream {
}
@Override
- public void write(byte[] b)
- throws IOException {
+ public void write(byte[] b) throws IOException {
findStream().write(b);
}
diff --git a/java/org/apache/tomcat/util/log/UserDataHelper.java
b/java/org/apache/tomcat/util/log/UserDataHelper.java
index 23a57cf3b4..5c2de49ad1 100644
--- a/java/org/apache/tomcat/util/log/UserDataHelper.java
+++ b/java/org/apache/tomcat/util/log/UserDataHelper.java
@@ -19,22 +19,20 @@ package org.apache.tomcat.util.log;
import org.apache.juli.logging.Log;
/**
- * This helper class assists with the logging associated with invalid input
- * data. A developer may want all instances of invalid input data logged to
- * assist with debugging whereas in production it is likely to be desirable not
- * to log anything for invalid data. The following settings may be used:
+ * This helper class assists with the logging associated with invalid input
data. A developer may want all instances of
+ * invalid input data logged to assist with debugging whereas in production it
is likely to be desirable not to log
+ * anything for invalid data. The following settings may be used:
* <ul>
* <li>NOTHING: Log nothing.</li>
* <li>DEBUG_ALL: Log all problems at DEBUG log level.</li>
- * <li>INFO_THEN_DEBUG: Log first problem at INFO log level and any further
- * issues in the following TBD (configurable) seconds at DEBUG level</li>
+ * <li>INFO_THEN_DEBUG: Log first problem at INFO log level and any further
issues in the following TBD (configurable)
+ * seconds at DEBUG level</li>
* <li>INFO_ALL: Log all problems at INFO log level.</li>
* </ul>
* By default, INFO_THEN_DEBUG is used with a suppression time of 24 hours.
* <p>
- * NOTE: This class is not completely thread-safe. When using INFO_THEN_DEBUG
it
- * is possible that several INFO messages will be logged before dropping to
- * DEBUG.
+ * NOTE: This class is not completely thread-safe. When using INFO_THEN_DEBUG
it is possible that several INFO messages
+ * will be logged before dropping to DEBUG.
*/
public class UserDataHelper {
@@ -54,8 +52,7 @@ public class UserDataHelper {
this.log = log;
Config tempConfig;
- String configString = System.getProperty(
- "org.apache.juli.logging.UserDataHelper.CONFIG");
+ String configString =
System.getProperty("org.apache.juli.logging.UserDataHelper.CONFIG");
if (configString == null) {
tempConfig = Config.INFO_THEN_DEBUG;
} else {
@@ -68,9 +65,9 @@ public class UserDataHelper {
}
// Default suppression time of 1 day.
- suppressionTime = Integer.getInteger(
- "org.apache.juli.logging.UserDataHelper.SUPPRESSION_TIME",
- 60 * 60 * 24).intValue() * 1000L;
+ suppressionTime =
+
Integer.getInteger("org.apache.juli.logging.UserDataHelper.SUPPRESSION_TIME",
60 * 60 * 24).intValue() *
+ 1000L;
if (suppressionTime == 0) {
tempConfig = Config.INFO_ALL;
@@ -81,12 +78,10 @@ public class UserDataHelper {
/**
- * Returns log mode for the next log message, or <code>null</code> if the
- * message should not be logged.
- *
+ * Returns log mode for the next log message, or <code>null</code> if the
message should not be logged.
* <p>
- * If <code>INFO_THEN_DEBUG</code> configuration option is enabled, this
- * method might change internal state of this object.
+ * If <code>INFO_THEN_DEBUG</code> configuration option is enabled, this
method might change internal state of this
+ * object.
*
* @return Log mode, or <code>null</code>
*/
@@ -110,9 +105,8 @@ public class UserDataHelper {
/*
- * Not completely thread-safe but good enough for this use case. I couldn't
- * see a simple enough way to make it completely thread-safe that was not
- * likely to compromise performance.
+ * Not completely thread-safe but good enough for this use case. I
couldn't see a simple enough way to make it
+ * completely thread-safe that was not likely to compromise performance.
*/
private boolean logAtInfo() {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]