123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441 |
-
- using SuperSocket.SocketBase.Logging;
- using System;
- namespace OCPPServer.SubProtocol
- {
- public class OCPPLog : ILog
- {
- private NLog.ILogger m_Log;
- public OCPPLog(string name)
- {
- m_Log = NLog.LogManager.GetCurrentClassLogger();
- }
- /// <summary>
- /// Gets a value indicating whether this instance is debug enabled.
- /// </summary>
- /// <value>
- /// <c>true</c> if this instance is debug enabled; otherwise, <c>false</c>.
- /// </value>
- public bool IsDebugEnabled
- {
- get { return m_Log.IsDebugEnabled; }
- }
- /// <summary>
- /// Gets a value indicating whether this instance is error enabled.
- /// </summary>
- /// <value>
- /// <c>true</c> if this instance is error enabled; otherwise, <c>false</c>.
- /// </value>
- public bool IsErrorEnabled
- {
- get { return m_Log.IsErrorEnabled; }
- }
- /// <summary>
- /// Gets a value indicating whether this instance is fatal enabled.
- /// </summary>
- /// <value>
- /// <c>true</c> if this instance is fatal enabled; otherwise, <c>false</c>.
- /// </value>
- public bool IsFatalEnabled
- {
- get { return m_Log.IsFatalEnabled; }
- }
- /// <summary>
- /// Gets a value indicating whether this instance is info enabled.
- /// </summary>
- /// <value>
- /// <c>true</c> if this instance is info enabled; otherwise, <c>false</c>.
- /// </value>
- public bool IsInfoEnabled
- {
- get { return m_Log.IsInfoEnabled; }
- }
- /// <summary>
- /// Gets a value indicating whether this instance is warn enabled.
- /// </summary>
- /// <value>
- /// <c>true</c> if this instance is warn enabled; otherwise, <c>false</c>.
- /// </value>
- public bool IsWarnEnabled
- {
- get { return m_Log.IsWarnEnabled; }
- }
- /// <summary>
- /// Logs the debug message.
- /// </summary>
- /// <param name="message">The message.</param>
- public void Debug(object message)
- {
- m_Log.Debug(message);
- }
- /// <summary>
- /// Logs the debug message.
- /// </summary>
- /// <param name="message">The message.</param>
- /// <param name="exception">The exception.</param>
- public void Debug(object message, Exception exception)
- {
- //m_Log.Debug((System.IFormatProvider)message, exception);
- m_Log.Debug(exception, message.ToString());
- }
- /// <summary>
- /// Logs the debug message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- public void DebugFormat(string format, object arg0)
- {
- }
- /// <summary>
- /// Logs the debug message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="args">The args.</param>
- public void DebugFormat(string format, params object[] args)
- {
- }
- /// <summary>
- /// Logs the debug message.
- /// </summary>
- /// <param name="provider">The provider.</param>
- /// <param name="format">The format.</param>
- /// <param name="args">The args.</param>
- public void DebugFormat(IFormatProvider provider, string format, params object[] args)
- {
- }
- /// <summary>
- /// Logs the debug message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- /// <param name="arg1">The arg1.</param>
- public void DebugFormat(string format, object arg0, object arg1)
- {
- }
- /// <summary>
- /// Logs the debug message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- /// <param name="arg1">The arg1.</param>
- /// <param name="arg2">The arg2.</param>
- public void DebugFormat(string format, object arg0, object arg1, object arg2)
- {
- }
- /// <summary>
- /// Logs the error message.
- /// </summary>
- /// <param name="message">The message.</param>
- public void Error(object message)
- {
- m_Log.Error(message);
- }
- /// <summary>
- /// Logs the error message.
- /// </summary>
- /// <param name="message">The message.</param>
- /// <param name="exception">The exception.</param>
- public void Error(object message, Exception exception)
- {
- //m_Log.Error((System.IFormatProvider)message, exception);
- m_Log.Error(exception.ToString());
- }
- /// <summary>
- /// Logs the error message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- public void ErrorFormat(string format, object arg0)
- {
- }
- /// <summary>
- /// Logs the error message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="args">The args.</param>
- public void ErrorFormat(string format, params object[] args)
- {
- }
- /// <summary>
- /// Logs the error message.
- /// </summary>
- /// <param name="provider">The provider.</param>
- /// <param name="format">The format.</param>
- /// <param name="args">The args.</param>
- public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
- {
- }
- /// <summary>
- /// Logs the error message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- /// <param name="arg1">The arg1.</param>
- public void ErrorFormat(string format, object arg0, object arg1)
- {
- }
- /// <summary>
- /// Logs the error message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- /// <param name="arg1">The arg1.</param>
- /// <param name="arg2">The arg2.</param>
- public void ErrorFormat(string format, object arg0, object arg1, object arg2)
- {
- }
- /// <summary>
- /// Logs the fatal error message.
- /// </summary>
- /// <param name="message">The message.</param>
- public void Fatal(object message)
- {
- m_Log.Fatal(message);
- }
- /// <summary>
- /// Logs the fatal error message.
- /// </summary>
- /// <param name="message">The message.</param>
- /// <param name="exception">The exception.</param>
- public void Fatal(object message, Exception exception)
- {
- m_Log.Fatal((System.IFormatProvider)message, exception);
- }
- /// <summary>
- /// Logs the fatal error message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- public void FatalFormat(string format, object arg0)
- {
- }
- /// <summary>
- /// Logs the fatal error message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="args">The args.</param>
- public void FatalFormat(string format, params object[] args)
- {
- }
- /// <summary>
- /// Logs the fatal error message.
- /// </summary>
- /// <param name="provider">The provider.</param>
- /// <param name="format">The format.</param>
- /// <param name="args">The args.</param>
- public void FatalFormat(IFormatProvider provider, string format, params object[] args)
- {
- }
- /// <summary>
- /// Logs the fatal error message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- /// <param name="arg1">The arg1.</param>
- public void FatalFormat(string format, object arg0, object arg1)
- {
- }
- /// <summary>
- /// Logs the fatal error message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- /// <param name="arg1">The arg1.</param>
- /// <param name="arg2">The arg2.</param>
- public void FatalFormat(string format, object arg0, object arg1, object arg2)
- {
- }
- /// <summary>
- /// Logs the info message.
- /// </summary>
- /// <param name="message">The message.</param>
- public void Info(object message)
- {
- m_Log.Info(message);
- }
- /// <summary>
- /// Logs the info message.
- /// </summary>
- /// <param name="message">The message.</param>
- /// <param name="exception">The exception.</param>
- public void Info(object message, Exception exception)
- {
- //m_Log.Info((System.IFormatProvider)message, exception);
- m_Log.Info(exception, message.ToString());
- }
- /// <summary>
- /// Logs the info message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- public void InfoFormat(string format, object arg0)
- {
- }
- /// <summary>
- /// Logs the info message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="args">The args.</param>
- public void InfoFormat(string format, params object[] args)
- {
- }
- /// <summary>
- /// Logs the info message.
- /// </summary>
- /// <param name="provider">The provider.</param>
- /// <param name="format">The format.</param>
- /// <param name="args">The args.</param>
- public void InfoFormat(IFormatProvider provider, string format, params object[] args)
- {
- }
- /// <summary>
- /// Logs the info message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- /// <param name="arg1">The arg1.</param>
- public void InfoFormat(string format, object arg0, object arg1)
- {
- }
- /// <summary>
- /// Logs the info message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- /// <param name="arg1">The arg1.</param>
- /// <param name="arg2">The arg2.</param>
- public void InfoFormat(string format, object arg0, object arg1, object arg2)
- {
- }
- /// <summary>
- /// Logs the warning message.
- /// </summary>
- /// <param name="message">The message.</param>
- public void Warn(object message)
- {
- m_Log.Warn(message);
- }
- /// <summary>
- /// Logs the warning message.
- /// </summary>
- /// <param name="message">The message.</param>
- /// <param name="exception">The exception.</param>
- public void Warn(object message, Exception exception)
- {
- //m_Log.Warn((System.IFormatProvider)message, exception);
- m_Log.Warn(exception, message.ToString());
- }
- /// <summary>
- /// Logs the warning message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- public void WarnFormat(string format, object arg0)
- {
- }
- /// <summary>
- /// Logs the warning message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="args">The args.</param>
- public void WarnFormat(string format, params object[] args)
- {
- }
- /// <summary>
- /// Logs the warning message.
- /// </summary>
- /// <param name="provider">The provider.</param>
- /// <param name="format">The format.</param>
- /// <param name="args">The args.</param>
- public void WarnFormat(IFormatProvider provider, string format, params object[] args)
- {
- }
- /// <summary>
- /// Logs the warning message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- /// <param name="arg1">The arg1.</param>
- public void WarnFormat(string format, object arg0, object arg1)
- {
- }
- /// <summary>
- /// Logs the warning message.
- /// </summary>
- /// <param name="format">The format.</param>
- /// <param name="arg0">The arg0.</param>
- /// <param name="arg1">The arg1.</param>
- /// <param name="arg2">The arg2.</param>
- public void WarnFormat(string format, object arg0, object arg1, object arg2)
- {
- }
- }
- }
|