forked from ltsopensource/light-task-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
# Conflicts: # lts-jobtracker/src/main/java/com/github/ltsopensource/jobtracker/sender/JobSender.java # pom.xml
- Loading branch information
Showing
29 changed files
with
288 additions
and
51 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
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
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
96 changes: 96 additions & 0 deletions
96
lts-core/src/main/java/com/github/ltsopensource/core/logger/logback/LogbackLogger.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,96 @@ | ||
package com.github.ltsopensource.core.logger.logback; | ||
|
||
import com.github.ltsopensource.core.logger.Logger; | ||
import com.github.ltsopensource.core.logger.support.AbstractLogger; | ||
|
||
import java.io.Serializable; | ||
|
||
public class LogbackLogger extends AbstractLogger implements Logger, Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
private final ch.qos.logback.classic.Logger logger; | ||
|
||
public LogbackLogger(ch.qos.logback.classic.Logger logger) { | ||
this.logger = logger; | ||
} | ||
|
||
public void trace(String msg) { | ||
logger.trace(msg); | ||
} | ||
|
||
public void trace(Throwable e) { | ||
logger.trace(e.getMessage(), e); | ||
} | ||
|
||
public void trace(String msg, Throwable e) { | ||
logger.trace(msg, e); | ||
} | ||
|
||
public void debug(String msg) { | ||
logger.debug(msg); | ||
} | ||
|
||
public void debug(Throwable e) { | ||
logger.debug(e.getMessage(), e); | ||
} | ||
|
||
public void debug(String msg, Throwable e) { | ||
logger.debug(msg, e); | ||
} | ||
|
||
public void info(String msg) { | ||
logger.info(msg); | ||
} | ||
|
||
public void info(Throwable e) { | ||
logger.info(e.getMessage(), e); | ||
} | ||
|
||
public void info(String msg, Throwable e) { | ||
logger.info(msg, e); | ||
} | ||
|
||
public void warn(String msg) { | ||
logger.warn(msg); | ||
} | ||
|
||
public void warn(Throwable e) { | ||
logger.warn(e.getMessage(), e); | ||
} | ||
|
||
public void warn(String msg, Throwable e) { | ||
logger.warn(msg, e); | ||
} | ||
|
||
public void error(String msg) { | ||
logger.error(msg); | ||
} | ||
|
||
public void error(Throwable e) { | ||
logger.error(e.getMessage(), e); | ||
} | ||
|
||
public void error(String msg, Throwable e) { | ||
logger.error(msg, e); | ||
} | ||
|
||
public boolean isTraceEnabled() { | ||
return logger.isTraceEnabled(); | ||
} | ||
|
||
public boolean isDebugEnabled() { | ||
return logger.isDebugEnabled(); | ||
} | ||
|
||
public boolean isInfoEnabled() { | ||
return logger.isInfoEnabled(); | ||
} | ||
|
||
public boolean isWarnEnabled() { | ||
return logger.isWarnEnabled(); | ||
} | ||
|
||
public boolean isErrorEnabled() { | ||
return logger.isErrorEnabled(); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...core/src/main/java/com/github/ltsopensource/core/logger/logback/LogbackLoggerAdapter.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,49 @@ | ||
package com.github.ltsopensource.core.logger.logback; | ||
|
||
import com.github.ltsopensource.core.logger.Level; | ||
import com.github.ltsopensource.core.logger.Logger; | ||
import com.github.ltsopensource.core.logger.LoggerAdapter; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.File; | ||
|
||
public class LogbackLoggerAdapter implements LoggerAdapter { | ||
|
||
public LogbackLoggerAdapter() { | ||
try { | ||
Class.forName("ch.qos.logback.classic.Logger"); | ||
} catch (ClassNotFoundException e) { | ||
throw new RuntimeException("ch.qos.logback.classic.Logger not found"); | ||
} | ||
} | ||
|
||
public Logger getLogger(String key) { | ||
return new LogbackLogger((ch.qos.logback.classic.Logger) LoggerFactory.getLogger(key)); | ||
} | ||
|
||
public Logger getLogger(Class<?> key) { | ||
return new LogbackLogger((ch.qos.logback.classic.Logger) LoggerFactory.getLogger(key)); | ||
} | ||
|
||
private Level level; | ||
|
||
private File file; | ||
|
||
public void setLevel(Level level) { | ||
this.level = level; | ||
} | ||
|
||
public Level getLevel() { | ||
return level; | ||
} | ||
|
||
public File getFile() { | ||
return file; | ||
} | ||
|
||
public void setFile(File file) { | ||
this.file = file; | ||
} | ||
|
||
} | ||
|
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
Oops, something went wrong.