Skip to content

Commit

Permalink
add logger module
Browse files Browse the repository at this point in the history
  • Loading branch information
InkerBot committed Jun 24, 2024
1 parent b473886 commit 1a8273a
Show file tree
Hide file tree
Showing 14 changed files with 1,486 additions and 0 deletions.
Binary file added LoggerProxy.class
Binary file not shown.
8 changes: 8 additions & 0 deletions logger/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dependencies {
api(project(":"))

compileOnly("org.apache.logging.log4j:log4j-api:2.23.1")
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl
testImplementation("org.apache.logging.log4j:log4j-slf4j-impl:2.23.1")

}
331 changes: 331 additions & 0 deletions logger/src/main/java/org/inksnow/cputil/logger/AuroraLogger.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,331 @@
package org.inksnow.cputil.logger;

import org.slf4j.Logger;
import org.slf4j.Marker;

public class AuroraLogger implements Logger {
public static final String UNMAPPED_SLF4J_PACKAGE_NAME = new String(new char[]{
'o', 'r', 'g', '.', 's', 'l', 'f', '4', 'j'
});
public static final String SLF4J_PACKAGE_NAME = Logger.class.getName().substring(0,
Logger.class.getName().lastIndexOf('.')
);
/* package-private */ final String name;
private final AuroraLoggerFactory factory;
/* package-private */ Logger delegate;
/* package-private */ int version = -1;

public AuroraLogger(AuroraLoggerFactory factory, String name) {
this.factory = factory;
this.name = name;
}

private Logger delegate() {
return factory.updateDelegate(this);
}

@Override
public String getName() {
return delegate().getName();
}

@Override
public boolean isTraceEnabled() {
return delegate().isTraceEnabled();
}

@Override
public void trace(String msg) {
delegate().trace(msg);
}

@Override
public void trace(String format, Object arg) {
delegate().trace(format, arg);
}

@Override
public void trace(String format, Object arg1, Object arg2) {
delegate().trace(format, arg1, arg2);
}

@Override
public void trace(String format, Object... arguments) {
delegate().trace(format, arguments);
}

@Override
public void trace(String msg, Throwable t) {
delegate().trace(msg, t);
}

@Override
public boolean isTraceEnabled(Marker marker) {
return delegate().isTraceEnabled(marker);
}

@Override
public void trace(Marker marker, String msg) {
delegate().trace(marker, msg);
}

@Override
public void trace(Marker marker, String format, Object arg) {
delegate().trace(marker, format, arg);
}

@Override
public void trace(Marker marker, String format, Object arg1, Object arg2) {
delegate().trace(marker, format, arg1, arg2);
}

@Override
public void trace(Marker marker, String format, Object... argArray) {
delegate().trace(marker, format, argArray);
}

@Override
public void trace(Marker marker, String msg, Throwable t) {
delegate().trace(marker, msg, t);
}

@Override
public boolean isDebugEnabled() {
return delegate().isDebugEnabled();
}

@Override
public void debug(String msg) {
delegate().debug(msg);
}

@Override
public void debug(String format, Object arg) {
delegate().debug(format, arg);
}

@Override
public void debug(String format, Object arg1, Object arg2) {
delegate().debug(format, arg1, arg2);
}

@Override
public void debug(String format, Object... arguments) {
delegate().debug(format, arguments);
}

@Override
public void debug(String msg, Throwable t) {
delegate().debug(msg, t);
}

@Override
public boolean isDebugEnabled(Marker marker) {
return delegate().isDebugEnabled(marker);
}

@Override
public void debug(Marker marker, String msg) {
delegate().debug(marker, msg);
}

@Override
public void debug(Marker marker, String format, Object arg) {
delegate().debug(marker, format, arg);
}

@Override
public void debug(Marker marker, String format, Object arg1, Object arg2) {
delegate().debug(marker, format, arg1, arg2);
}

@Override
public void debug(Marker marker, String format, Object... arguments) {
delegate().debug(marker, format, arguments);
}

@Override
public void debug(Marker marker, String msg, Throwable t) {
delegate().debug(marker, msg, t);
}

@Override
public boolean isInfoEnabled() {
return delegate().isInfoEnabled();
}

@Override
public void info(String msg) {
delegate().info(msg);
}

@Override
public void info(String format, Object arg) {
delegate().info(format, arg);
}

@Override
public void info(String format, Object arg1, Object arg2) {
delegate().info(format, arg1, arg2);
}

@Override
public void info(String format, Object... arguments) {
delegate().info(format, arguments);
}

@Override
public void info(String msg, Throwable t) {
delegate().info(msg, t);
}

@Override
public boolean isInfoEnabled(Marker marker) {
return delegate().isInfoEnabled(marker);
}

@Override
public void info(Marker marker, String msg) {
delegate().info(marker, msg);
}

@Override
public void info(Marker marker, String format, Object arg) {
delegate().info(marker, format, arg);
}

@Override
public void info(Marker marker, String format, Object arg1, Object arg2) {
delegate().info(marker, format, arg1, arg2);
}

@Override
public void info(Marker marker, String format, Object... arguments) {
delegate().info(marker, format, arguments);
}

@Override
public void info(Marker marker, String msg, Throwable t) {
delegate().info(marker, msg, t);
}

@Override
public boolean isWarnEnabled() {
return delegate().isWarnEnabled();
}

@Override
public void warn(String msg) {
delegate().warn(msg);
}

@Override
public void warn(String format, Object arg) {
delegate().warn(format, arg);
}

@Override
public void warn(String format, Object... arguments) {
delegate().warn(format, arguments);
}

@Override
public void warn(String format, Object arg1, Object arg2) {
delegate().warn(format, arg1, arg2);
}

@Override
public void warn(String msg, Throwable t) {
delegate().warn(msg, t);
}

@Override
public boolean isWarnEnabled(Marker marker) {
return delegate().isWarnEnabled(marker);
}

@Override
public void warn(Marker marker, String msg) {
delegate().warn(marker, msg);
}

@Override
public void warn(Marker marker, String format, Object arg) {
delegate().warn(marker, format, arg);
}

@Override
public void warn(Marker marker, String format, Object arg1, Object arg2) {
delegate().warn(marker, format, arg1, arg2);
}

@Override
public void warn(Marker marker, String format, Object... arguments) {
delegate().warn(marker, format, arguments);
}

@Override
public void warn(Marker marker, String msg, Throwable t) {
delegate().warn(marker, msg, t);
}

@Override
public boolean isErrorEnabled() {
return delegate().isErrorEnabled();
}

@Override
public void error(String msg) {
delegate().error(msg);
}

@Override
public void error(String format, Object arg) {
delegate().error(format, arg);
}

@Override
public void error(String format, Object arg1, Object arg2) {
delegate().error(format, arg1, arg2);
}

@Override
public void error(String format, Object... arguments) {
delegate().error(format, arguments);
}

@Override
public void error(String msg, Throwable t) {
delegate().error(msg, t);
}

@Override
public boolean isErrorEnabled(Marker marker) {
return delegate().isErrorEnabled(marker);
}

@Override
public void error(Marker marker, String msg) {
delegate().error(marker, msg);
}

@Override
public void error(Marker marker, String format, Object arg) {
delegate().error(marker, format, arg);
}

@Override
public void error(Marker marker, String format, Object arg1, Object arg2) {
delegate().error(marker, format, arg1, arg2);
}

@Override
public void error(Marker marker, String format, Object... arguments) {
delegate().error(marker, format, arguments);
}

@Override
public void error(Marker marker, String msg, Throwable t) {
delegate().error(marker, msg, t);
}
}
Loading

0 comments on commit 1a8273a

Please sign in to comment.