-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving to multi-release builds with JDK17 See merge request weblogic-cloud/weblogic-deploy-tooling!1524
- Loading branch information
Showing
14 changed files
with
863 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
core/src/main/java17/oracle/weblogic/deploy/logging/LoggingUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2019, 2022, Oracle Corporation and/or its affiliates. | ||
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. | ||
*/ | ||
package oracle.weblogic.deploy.logging; | ||
|
||
import java.util.Properties; | ||
import java.util.logging.LogRecord; | ||
|
||
/** | ||
* Utility class with methods used by the logging framework. | ||
*/ | ||
public class LoggingUtils { | ||
|
||
private LoggingUtils() { | ||
// hide the constructor | ||
} | ||
|
||
/** | ||
* Make a copy of a log record without the exception. | ||
* | ||
* @param logRecord the log record to copy | ||
* @return the cloned log record without the exception | ||
*/ | ||
public static LogRecord cloneRecordWithoutException(LogRecord logRecord) { | ||
LogRecord newRecord = new LogRecord(logRecord.getLevel(), logRecord.getMessage()); | ||
|
||
newRecord.setLoggerName(logRecord.getLoggerName()); | ||
newRecord.setInstant(logRecord.getInstant()); | ||
newRecord.setParameters(logRecord.getParameters()); | ||
newRecord.setResourceBundle(logRecord.getResourceBundle()); | ||
newRecord.setResourceBundleName(logRecord.getResourceBundleName()); | ||
newRecord.setSequenceNumber(logRecord.getSequenceNumber()); | ||
newRecord.setSourceClassName(logRecord.getSourceClassName()); | ||
newRecord.setSourceMethodName(logRecord.getSourceMethodName()); | ||
newRecord.setLongThreadID(logRecord.getLongThreadID()); | ||
// Skip thrown | ||
return newRecord; | ||
} | ||
|
||
public static void printLogProperties(Properties logProps, String prefix) { | ||
if (logProps != null) { | ||
for (String propName : logProps.stringPropertyNames()) { | ||
System.err.println(prefix + propName + '=' + logProps.getProperty(propName)); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.