Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Commit 463e781

Browse files
committed
格式化代码
1 parent 4236f0b commit 463e781

File tree

1 file changed

+24
-18
lines changed
  • sofa-serverless-runtime/sofa-serverless-adapter-ext/sofa-serverless-adapter-log4j2/src/main/java/org/apache/logging/slf4j

1 file changed

+24
-18
lines changed

sofa-serverless-runtime/sofa-serverless-adapter-ext/sofa-serverless-adapter-log4j2/src/main/java/org/apache/logging/slf4j/Log4jLogger.java

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
22
* Licensed to the Apache Software Foundation (ASF) under one or more
3-
* contributor license agreements. See the NOTICE file distributed with
3+
* contributor license agreements. See the NOTICE file distributed with
44
* this work for additional information regarding copyright ownership.
5-
* The ASF licenses this file to You under the Apache license, Version 2.0
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
66
* (the "License"); you may not use this file except in compliance with
7-
* the License. You may obtain a copy of the License at
7+
* the License. You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1010
*
1111
* Unless required by applicable law or agreed to in writing, software
1212
* distributed under the License is distributed on an "AS IS" BASIS,
1313
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the license for the specific language governing permissions and
15-
* limitations under the license.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
1616
*/
1717
package org.apache.logging.slf4j;
1818

@@ -41,16 +41,18 @@
4141
*/
4242
public class Log4jLogger implements LocationAwareLogger, Serializable {
4343

44-
public static final String FQCN = Log4jLogger.class.getName();
44+
public static final String FQCN = Log4jLogger.class
45+
.getName();
4546

46-
private static final long serialVersionUID = 7869000638091304316L;
47-
private static final Marker EVENT_MARKER = MarkerFactory.getMarker("EVENT");
48-
private static final EventDataConverter CONVERTER = createConverter();
47+
private static final long serialVersionUID = 7869000638091304316L;
48+
private static final Marker EVENT_MARKER = MarkerFactory
49+
.getMarker("EVENT");
50+
private static final EventDataConverter CONVERTER = createConverter();
4951

50-
private final boolean eventLogger;
51-
private transient final Map<ClassLoader, ExtendedLogger> loggerMap = new ConcurrentHashMap<>();
52-
private static final Map<ClassLoader, LoggerContext> LOGGER_CONTEXT_MAP = new ConcurrentHashMap<>();
53-
private final String name;
52+
private final boolean eventLogger;
53+
private transient final Map<ClassLoader, ExtendedLogger> loggerMap = new ConcurrentHashMap<>();
54+
private static final Map<ClassLoader, LoggerContext> LOGGER_CONTEXT_MAP = new ConcurrentHashMap<>();
55+
private final String name;
5456

5557
public Log4jLogger(final ExtendedLogger logger, final String name) {
5658
this.eventLogger = "EventLogger".equals(name);
@@ -358,7 +360,8 @@ public void error(final Marker marker, final String s, final Throwable throwable
358360
}
359361

360362
@Override
361-
public void log(final Marker marker, final String fqcn, final int level, final String message, final Object[] params, Throwable throwable) {
363+
public void log(final Marker marker, final String fqcn, final int level, final String message,
364+
final Object[] params, Throwable throwable) {
362365
final Level log4jLevel = getLevel(level);
363366
final org.apache.logging.log4j.Marker log4jMarker = getMarker(marker);
364367
ExtendedLogger logger = getLogger();
@@ -386,7 +389,8 @@ private static org.apache.logging.log4j.Marker getMarker(final Marker marker) {
386389
} else if (marker instanceof Log4jMarker) {
387390
return ((Log4jMarker) marker).getLog4jMarker();
388391
} else {
389-
final Log4jMarkerFactory factory = (Log4jMarkerFactory) StaticMarkerBinder.SINGLETON.getMarkerFactory();
392+
final Log4jMarkerFactory factory = (Log4jMarkerFactory) StaticMarkerBinder.SINGLETON
393+
.getMarkerFactory();
390394
return ((Log4jMarker) factory.getMarker(marker)).getLog4jMarker();
391395
}
392396
}
@@ -400,7 +404,8 @@ public String getName() {
400404
* Always treat de-serialization as a full-blown constructor, by validating the final state of
401405
* the de-serialized object.
402406
*/
403-
private void readObject(final ObjectInputStream aInputStream) throws ClassNotFoundException, IOException {
407+
private void readObject(final ObjectInputStream aInputStream) throws ClassNotFoundException,
408+
IOException {
404409
// always perform the default de-serialization first
405410
aInputStream.defaultReadObject();
406411
}
@@ -447,7 +452,8 @@ private ExtendedLogger getLogger() {
447452
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
448453
LoggerContext loggerContext = LOGGER_CONTEXT_MAP.get(classLoader);
449454
if (loggerContext == null) {
450-
loggerContext = LogManager.getContext(Thread.currentThread().getContextClassLoader(), false);
455+
loggerContext = LogManager.getContext(Thread.currentThread().getContextClassLoader(),
456+
false);
451457
LOGGER_CONTEXT_MAP.put(classLoader, loggerContext);
452458
}
453459
ExtendedLogger extendedLogger = loggerMap.get(classLoader);

0 commit comments

Comments
 (0)