You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
279 lines
8.4 KiB
279 lines
8.4 KiB
using log4net;
|
|
using log4net.Core;
|
|
using System;
|
|
using KPlan.Util;
|
|
|
|
namespace KPlan.Logger {
|
|
public class TLogAgent {
|
|
private TLogManager logManager;
|
|
|
|
private ILog theLogger;
|
|
|
|
private string subSystem;
|
|
|
|
private bool IsOn {
|
|
get {
|
|
if (this.logManager != null && this.logManager.IsOn) {
|
|
if (this.theLogger == null) {
|
|
this.theLogger = LogManager.GetLogger(this.subSystem);
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public bool IsDebugEnabled {
|
|
get {
|
|
return this.IsOn && this.theLogger.IsDebugEnabled;
|
|
}
|
|
}
|
|
|
|
public bool IsInfoEnabled {
|
|
get {
|
|
return this.IsOn && this.theLogger.IsInfoEnabled;
|
|
}
|
|
}
|
|
|
|
public bool IsWarnEnabled {
|
|
get {
|
|
return this.IsOn && this.theLogger.IsWarnEnabled;
|
|
}
|
|
}
|
|
|
|
public bool IsErrorEnabled {
|
|
get {
|
|
return this.IsOn && this.theLogger.IsErrorEnabled;
|
|
}
|
|
}
|
|
|
|
public bool IsFatalEnabled {
|
|
get {
|
|
return this.IsOn && this.theLogger.IsFatalEnabled;
|
|
}
|
|
}
|
|
|
|
public ILogger Logger {
|
|
get {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
internal TLogAgent(TLogManager m, string s) {
|
|
this.logManager = m;
|
|
this.subSystem = s;
|
|
}
|
|
|
|
public void Fatal(object message) {
|
|
if (this.IsOn && this.theLogger.IsFatalEnabled) {
|
|
this.theLogger.Fatal(message);
|
|
}
|
|
}
|
|
|
|
public void Fatal(object message, Exception exception) {
|
|
if (this.IsOn && this.theLogger.IsFatalEnabled) {
|
|
this.theLogger.Fatal(message, exception);
|
|
}
|
|
}
|
|
|
|
public void FatalFormat(string format, object arg0) {
|
|
if (this.IsOn && this.theLogger.IsFatalEnabled) {
|
|
this.theLogger.FatalFormat(format, arg0);
|
|
}
|
|
}
|
|
|
|
public void FatalFormat(string format, object arg0, object arg1) {
|
|
if (this.IsOn && this.theLogger.IsFatalEnabled) {
|
|
this.theLogger.FatalFormat(format, arg0, arg1);
|
|
}
|
|
}
|
|
|
|
public void FatalFormat(string format, object arg0, object arg1, object arg2) {
|
|
if (this.IsOn && this.theLogger.IsFatalEnabled) {
|
|
this.theLogger.FatalFormat(format, arg0, arg1, arg2);
|
|
}
|
|
}
|
|
|
|
public void FatalFormat(string format, params object[] args) {
|
|
if (this.IsOn && this.theLogger.IsFatalEnabled) {
|
|
this.theLogger.FatalFormat(format, args);
|
|
}
|
|
}
|
|
|
|
public void FatalFormat(IFormatProvider provider, string format, params object[] args) {
|
|
if (this.IsOn && this.theLogger.IsFatalEnabled) {
|
|
this.theLogger.FatalFormat(provider, format, args);
|
|
}
|
|
}
|
|
|
|
public void Error(object message) {
|
|
if (this.IsOn && this.theLogger.IsErrorEnabled) {
|
|
this.theLogger.Error(message);
|
|
}
|
|
}
|
|
|
|
public void Error(object message, Exception exception) {
|
|
if (this.IsOn && this.theLogger.IsErrorEnabled) {
|
|
this.theLogger.Error(message, exception);
|
|
}
|
|
}
|
|
|
|
public void ErrorFormat(string format, object arg0) {
|
|
if (this.IsOn && this.theLogger.IsErrorEnabled) {
|
|
this.theLogger.ErrorFormat(format, arg0);
|
|
}
|
|
}
|
|
|
|
public void ErrorFormat(string format, object arg0, object arg1) {
|
|
if (this.IsOn && this.theLogger.IsErrorEnabled) {
|
|
this.theLogger.ErrorFormat(format, arg0, arg1);
|
|
}
|
|
}
|
|
|
|
public void ErrorFormat(string format, object arg0, object arg1, object arg2) {
|
|
if (this.IsOn && this.theLogger.IsErrorEnabled) {
|
|
this.theLogger.ErrorFormat(format, arg0, arg1, arg2);
|
|
}
|
|
}
|
|
|
|
public void ErrorFormat(string format, params object[] args) {
|
|
if (this.IsOn && this.theLogger.IsErrorEnabled) {
|
|
this.theLogger.ErrorFormat(format, args);
|
|
}
|
|
}
|
|
|
|
public void ErrorFormat(IFormatProvider provider, string format, params object[] args) {
|
|
if (this.IsOn && this.theLogger.IsErrorEnabled) {
|
|
this.theLogger.ErrorFormat(provider, format, args);
|
|
}
|
|
}
|
|
|
|
public void Warn(object message, Exception exception) {
|
|
if (this.IsOn && this.theLogger.IsWarnEnabled) {
|
|
this.theLogger.Warn(message, exception);
|
|
}
|
|
}
|
|
|
|
public void Warn(object message) {
|
|
if (this.IsOn && this.theLogger.IsWarnEnabled) {
|
|
this.theLogger.Warn(message);
|
|
}
|
|
}
|
|
|
|
public void WarnFormat(string format, object arg0) {
|
|
if (this.IsOn && this.theLogger.IsWarnEnabled) {
|
|
this.theLogger.WarnFormat(format, arg0);
|
|
}
|
|
}
|
|
|
|
public void WarnFormat(string format, object arg0, object arg1) {
|
|
if (this.IsOn && this.theLogger.IsWarnEnabled) {
|
|
this.theLogger.WarnFormat(format, arg0, arg1);
|
|
}
|
|
}
|
|
|
|
public void WarnFormat(string format, object arg0, object arg1, object arg2) {
|
|
if (this.IsOn && this.theLogger.IsWarnEnabled) {
|
|
this.theLogger.WarnFormat(format, arg0, arg1, arg2);
|
|
}
|
|
}
|
|
|
|
public void WarnFormat(IFormatProvider provider, string format, params object[] args) {
|
|
if (this.IsOn && this.theLogger.IsWarnEnabled) {
|
|
this.theLogger.WarnFormat(provider, format, args);
|
|
}
|
|
}
|
|
|
|
public void WarnFormat(string format, params object[] args) {
|
|
if (this.IsOn && this.theLogger.IsWarnEnabled) {
|
|
this.theLogger.WarnFormat(format, args);
|
|
}
|
|
}
|
|
|
|
public void Info(object message) {
|
|
if (this.IsOn && this.theLogger.IsInfoEnabled) {
|
|
this.theLogger.Info(message);
|
|
}
|
|
}
|
|
|
|
public void Info(object message, Exception exception) {
|
|
if (this.IsOn && this.theLogger.IsInfoEnabled) {
|
|
this.theLogger.Info(message, exception);
|
|
}
|
|
}
|
|
|
|
public void InfoFormat(string format, object arg0) {
|
|
if (this.IsOn && this.theLogger.IsInfoEnabled) {
|
|
this.theLogger.InfoFormat(format, arg0);
|
|
}
|
|
}
|
|
|
|
public void InfoFormat(string format, object arg0, object arg1) {
|
|
if (this.IsOn && this.theLogger.IsInfoEnabled) {
|
|
this.theLogger.InfoFormat(format, arg0, arg1);
|
|
}
|
|
}
|
|
|
|
public void InfoFormat(string format, object arg0, object arg1, object arg2) {
|
|
if (this.IsOn && this.theLogger.IsInfoEnabled) {
|
|
this.theLogger.InfoFormat(format, arg0, arg1, arg2);
|
|
}
|
|
}
|
|
|
|
public void InfoFormat(string format, params object[] args) {
|
|
if (this.IsOn && this.theLogger.IsInfoEnabled) {
|
|
this.theLogger.InfoFormat(format, args);
|
|
}
|
|
}
|
|
|
|
public void InfoFormat(IFormatProvider provider, string format, params object[] args) {
|
|
if (this.IsOn && this.theLogger.IsInfoEnabled) {
|
|
this.theLogger.InfoFormat(provider, format, args);
|
|
}
|
|
}
|
|
|
|
public void Debug(object message) {
|
|
|
|
if (this.IsOn && this.theLogger.IsDebugEnabled) {
|
|
this.theLogger.Debug(message);
|
|
}
|
|
}
|
|
|
|
public void Debug(object message, Exception exception) {
|
|
if (this.IsOn && this.theLogger.IsDebugEnabled) {
|
|
this.theLogger.Debug(message, exception);
|
|
}
|
|
}
|
|
|
|
public void DebugFormat(string format, object arg0) {
|
|
if (this.IsOn && this.theLogger.IsDebugEnabled) {
|
|
this.theLogger.DebugFormat(format, arg0);
|
|
}
|
|
}
|
|
|
|
public void DebugFormat(string format, object arg0, object arg1) {
|
|
if (this.IsOn && this.theLogger.IsDebugEnabled) {
|
|
this.theLogger.DebugFormat(format, arg0, arg1);
|
|
}
|
|
}
|
|
|
|
public void DebugFormat(string format, object arg0, object arg1, object arg2) {
|
|
if (this.IsOn && this.theLogger.IsDebugEnabled) {
|
|
this.theLogger.DebugFormat(format, arg0, arg1, arg2);
|
|
}
|
|
}
|
|
|
|
public void DebugFormat(string format, params object[] args) {
|
|
if (this.IsOn && this.theLogger.IsDebugEnabled) {
|
|
this.theLogger.DebugFormat(format, args);
|
|
}
|
|
}
|
|
|
|
public void DebugFormat(IFormatProvider provider, string format, params object[] args) {
|
|
if (this.IsOn && this.theLogger.IsDebugEnabled) {
|
|
this.theLogger.DebugFormat(provider, format, args);
|
|
}
|
|
}
|
|
}
|
|
}
|