📄 logimpl.cs
字号:
/// <c>String.Format</c> for details of the syntax of the format string and the behavior
/// of the formatting.
/// </para>
/// <para>
/// This method does not take an <see cref="Exception"/> object to include in the
/// log event. To pass an <see cref="Exception"/> use one of the <see cref="Debug(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void DebugFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsDebugEnabled)
{
Logger.Log(ThisDeclaringType, m_levelDebug, new SystemStringFormat(provider, format, args), null);
}
}
/// <summary>
/// Logs a message object with the <c>INFO</c> level.
/// </summary>
/// <param name="message">The message object to log.</param>
/// <remarks>
/// <para>
/// This method first checks if this logger is <c>INFO</c>
/// enabled by comparing the level of this logger with the
/// <c>INFO</c> level. If this logger is
/// <c>INFO</c> enabled, then it converts the message object
/// (passed as parameter) to a string by invoking the appropriate
/// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
/// proceeds to call all the registered appenders in this logger
/// and also higher in the hierarchy depending on the value of
/// the additivity flag.
/// </para>
/// <para>
/// <b>WARNING</b> Note that passing an <see cref="Exception"/>
/// to this method will print the name of the <see cref="Exception"/>
/// but no stack trace. To print a stack trace use the
/// <see cref="Info(object,Exception)"/> form instead.
/// </para>
/// </remarks>
virtual public void Info(object message)
{
Logger.Log(ThisDeclaringType, m_levelInfo, message, null);
}
/// <summary>
/// Logs a message object with the <c>INFO</c> level.
/// </summary>
/// <param name="message">The message object to log.</param>
/// <param name="exception">The exception to log, including its stack trace.</param>
/// <remarks>
/// <para>
/// Logs a message object with the <c>INFO</c> level including
/// the stack trace of the <see cref="Exception"/> <paramref name="exception"/>
/// passed as a parameter.
/// </para>
/// <para>
/// See the <see cref="Info(object)"/> form for more detailed information.
/// </para>
/// </remarks>
/// <seealso cref="Info(object)"/>
virtual public void Info(object message, Exception exception)
{
Logger.Log(ThisDeclaringType, m_levelInfo, message, exception);
}
/// <summary>
/// Logs a formatted message string with the <c>INFO</c> level.
/// </summary>
/// <param name="format">A String containing zero or more format items</param>
/// <param name="args">An Object array containing zero or more objects to format</param>
/// <remarks>
/// <para>
/// The message is formatted using the <see cref="String.Format(IFormatProvider, string, object[])"/> method. See
/// <c>String.Format</c> for details of the syntax of the format string and the behavior
/// of the formatting.
/// </para>
/// <para>
/// The string is formatted using the <see cref="CultureInfo.InvariantCulture"/>
/// format provider. To specify a localized provider use the
/// <see cref="InfoFormat(IFormatProvider,string,object[])"/> method.
/// </para>
/// <para>
/// This method does not take an <see cref="Exception"/> object to include in the
/// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void InfoFormat(string format, params object[] args)
{
if (IsInfoEnabled)
{
Logger.Log(ThisDeclaringType, m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null);
}
}
/// <summary>
/// Logs a formatted message string with the <c>INFO</c> level.
/// </summary>
/// <param name="format">A String containing zero or more format items</param>
/// <param name="arg0">An Object to format</param>
/// <remarks>
/// <para>
/// The message is formatted using the <see cref="String.Format(IFormatProvider, string, object[])"/> method. See
/// <c>String.Format</c> for details of the syntax of the format string and the behavior
/// of the formatting.
/// </para>
/// <para>
/// The string is formatted using the <see cref="CultureInfo.InvariantCulture"/>
/// format provider. To specify a localized provider use the
/// <see cref="InfoFormat(IFormatProvider,string,object[])"/> method.
/// </para>
/// <para>
/// This method does not take an <see cref="Exception"/> object to include in the
/// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void InfoFormat(string format, object arg0)
{
if (IsInfoEnabled)
{
Logger.Log(ThisDeclaringType, m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null);
}
}
/// <summary>
/// Logs a formatted message string with the <c>INFO</c> level.
/// </summary>
/// <param name="format">A String containing zero or more format items</param>
/// <param name="arg0">An Object to format</param>
/// <param name="arg1">An Object to format</param>
/// <remarks>
/// <para>
/// The message is formatted using the <see cref="String.Format(IFormatProvider, string, object[])"/> method. See
/// <c>String.Format</c> for details of the syntax of the format string and the behavior
/// of the formatting.
/// </para>
/// <para>
/// The string is formatted using the <see cref="CultureInfo.InvariantCulture"/>
/// format provider. To specify a localized provider use the
/// <see cref="InfoFormat(IFormatProvider,string,object[])"/> method.
/// </para>
/// <para>
/// This method does not take an <see cref="Exception"/> object to include in the
/// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void InfoFormat(string format, object arg0, object arg1)
{
if (IsInfoEnabled)
{
Logger.Log(ThisDeclaringType, m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null);
}
}
/// <summary>
/// Logs a formatted message string with the <c>INFO</c> level.
/// </summary>
/// <param name="format">A String containing zero or more format items</param>
/// <param name="arg0">An Object to format</param>
/// <param name="arg1">An Object to format</param>
/// <param name="arg2">An Object to format</param>
/// <remarks>
/// <para>
/// The message is formatted using the <see cref="String.Format(IFormatProvider, string, object[])"/> method. See
/// <c>String.Format</c> for details of the syntax of the format string and the behavior
/// of the formatting.
/// </para>
/// <para>
/// The string is formatted using the <see cref="CultureInfo.InvariantCulture"/>
/// format provider. To specify a localized provider use the
/// <see cref="InfoFormat(IFormatProvider,string,object[])"/> method.
/// </para>
/// <para>
/// This method does not take an <see cref="Exception"/> object to include in the
/// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void InfoFormat(string format, object arg0, object arg1, object arg2)
{
if (IsInfoEnabled)
{
Logger.Log(ThisDeclaringType, m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null);
}
}
/// <summary>
/// Logs a formatted message string with the <c>INFO</c> level.
/// </summary>
/// <param name="provider">An <see cref="IFormatProvider"/> that supplies culture-specific formatting information</param>
/// <param name="format">A String containing zero or more format items</param>
/// <param name="args">An Object array containing zero or more objects to format</param>
/// <remarks>
/// <para>
/// The message is formatted using the <see cref="String.Format(IFormatProvider, string, object[])"/> method. See
/// <c>String.Format</c> for details of the syntax of the format string and the behavior
/// of the formatting.
/// </para>
/// <para>
/// This method does not take an <see cref="Exception"/> object to include in the
/// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void InfoFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsInfoEnabled)
{
Logger.Log(ThisDeclaringType, m_levelInfo, new SystemStringFormat(provider, format, args), null);
}
}
/// <summary>
/// Logs a message object with the <c>WARN</c> level.
/// </summary>
/// <param name="message">the message object to log</param>
/// <remarks>
/// <para>
/// This method first checks if this logger is <c>WARN</c>
/// enabled by comparing the level of this logger with the
/// <c>WARN</c> level. If this logger is
/// <c>WARN</c> enabled, then it converts the message object
/// (passed as parameter) to a string by invoking the appropriate
/// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
/// proceeds to call all the registered appenders in this logger and
/// also higher in the hierarchy depending on the value of the
/// additivity flag.
/// </para>
/// <para>
/// <b>WARNING</b> Note that passing an <see cref="Exception"/> to this
/// method will print the name of the <see cref="Exception"/> but no
/// stack trace. To print a stack trace use the
/// <see cref="Warn(object,Exception)"/> form instead.
/// </para>
/// </remarks>
virtual public void Warn(object message)
{
Logger.Log(ThisDeclaringType, m_levelWarn, message, null);
}
/// <summary>
/// Logs a message object with the <c>WARN</c> level
/// </summary>
/// <param name="message">The message object to log.</param>
/// <param name="exception">The exception to log, including its stack trace.</param>
/// <remarks>
/// <para>
/// Logs a message object with the <c>WARN</c> level including
/// the stack trace of the <see cref="Exception"/> <paramref name="exception"/>
/// passed as a parameter.
/// </para>
/// <para>
/// See the <see cref="Warn(object)"/> form for more detailed information.
/// </para>
/// </remarks>
/// <seealso cref="Warn(object)"/>
virtual public void Warn(object message, Exception exception)
{
Logger.Log(ThisDeclaringType, m_levelWarn, message, exception);
}
/// <summary>
/// Logs a formatted message string with the <c>WARN</c> level.
/// </summary>
/// <param name="format">A String containing zero or more format items</param>
/// <param name="args">An Object array containing zero or more objects to format</param>
/// <remarks>
/// <para>
/// The message is formatted using the <see cref="String.Format(IFormatProvider, string, object[])"/> method. See
/// <c>String.Format</c> for details of the syntax of the format string and the behavior
/// of the formatting.
/// </para>
/// <para>
/// The string is formatted using the <see cref="CultureInfo.InvariantCulture"/>
/// format provider. To specify a localized provider use the
/// <see cref="WarnFormat(IFormatProvider,string,object[])"/> method.
/// </para>
/// <para>
/// This method does not take an <see cref="Exception"/> object to include in the
/// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void WarnFormat(string format, params object[] args)
{
if (IsWarnEnabled)
{
Logger.Log(ThisDeclaringType, m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null);
}
}
/// <summary>
/// Logs a formatted message string with the <c>WARN</c> level.
/// </summary>
/// <param name="format">A String containing zero or more format items</param>
/// <param name="arg0">An Object to format</param>
/// <remarks>
/// <para>
/// The message is formatted using the <see cref="String.Format(IFormatProvider, string, object[])"/> method. See
/// <c>String.Format</c> for details of the syntax of the format string and the behavior
/// of the formatting.
/// </para>
/// <para>
/// The string is formatted using the <see cref="CultureInfo.InvariantCulture"/>
/// format provider. To specify a localized provider use the
/// <see cref="WarnFormat(IFormatProvider,string,object[])"/> method.
/// </para>
/// <para>
/// This method does not take an <see cref="Exception"/> object to include in the
/// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void WarnFormat(string format, object arg0)
{
if (IsWarnEnabled)
{
Logger.Log(ThisDeclaringType, m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -