📄 logimpl.cs
字号:
/// <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>
/// <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="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, object arg1)
{
if (IsWarnEnabled)
{
Logger.Log(ThisDeclaringType, m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), 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>
/// <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="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, object arg1, object arg2)
{
if (IsWarnEnabled)
{
Logger.Log(ThisDeclaringType, m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null);
}
}
/// <summary>
/// Logs a formatted message string with the <c>WARN</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="Warn(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void WarnFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsWarnEnabled)
{
Logger.Log(ThisDeclaringType, m_levelWarn, new SystemStringFormat(provider, format, args), null);
}
}
/// <summary>
/// Logs a message object with the <c>ERROR</c> level.
/// </summary>
/// <param name="message">The message object to log.</param>
/// <remarks>
/// <para>
/// This method first checks if this logger is <c>ERROR</c>
/// enabled by comparing the level of this logger with the
/// <c>ERROR</c> level. If this logger is
/// <c>ERROR</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="Error(object,Exception)"/> form instead.
/// </para>
/// </remarks>
virtual public void Error(object message)
{
Logger.Log(ThisDeclaringType, m_levelError, message, null);
}
/// <summary>
/// Logs a message object with the <c>ERROR</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>ERROR</c> level including
/// the stack trace of the <see cref="Exception"/> <paramref name="exception"/>
/// passed as a parameter.
/// </para>
/// <para>
/// See the <see cref="Error(object)"/> form for more detailed information.
/// </para>
/// </remarks>
/// <seealso cref="Error(object)"/>
virtual public void Error(object message, Exception exception)
{
Logger.Log(ThisDeclaringType, m_levelError, message, exception);
}
/// <summary>
/// Logs a formatted message string with the <c>ERROR</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="ErrorFormat(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="Error(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void ErrorFormat(string format, params object[] args)
{
if (IsErrorEnabled)
{
Logger.Log(ThisDeclaringType, m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null);
}
}
/// <summary>
/// Logs a formatted message string with the <c>ERROR</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="ErrorFormat(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="Error(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void ErrorFormat(string format, object arg0)
{
if (IsErrorEnabled)
{
Logger.Log(ThisDeclaringType, m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null);
}
}
/// <summary>
/// Logs a formatted message string with the <c>ERROR</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="ErrorFormat(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="Error(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void ErrorFormat(string format, object arg0, object arg1)
{
if (IsErrorEnabled)
{
Logger.Log(ThisDeclaringType, m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null);
}
}
/// <summary>
/// Logs a formatted message string with the <c>ERROR</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="ErrorFormat(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="Error(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void ErrorFormat(string format, object arg0, object arg1, object arg2)
{
if (IsErrorEnabled)
{
Logger.Log(ThisDeclaringType, m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null);
}
}
/// <summary>
/// Logs a formatted message string with the <c>ERROR</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="Error(object)"/>
/// methods instead.
/// </para>
/// </remarks>
virtual public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsErrorEnabled)
{
Logger.Log(ThisDeclaringType, m_levelError, new SystemStringFormat(provider, format, args), null);
}
}
/// <summary>
/// Logs a message object with the <c>FATAL</c> level.
/// </summary>
/// <param name="message">The message object to log.</param>
/// <remarks>
/// <para>
/// This method first checks if this logger is <c>FATAL</c>
/// enabled by comparing the level of this logger with the
/// <c>FATAL</c> level. If this logger is
/// <c>FATAL</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="Fatal(object,Exception)"/> form instead.
/// </para>
/// </remarks>
virtual public void Fatal(object message)
{
Logger.Log(ThisDeclaringType, m_levelFatal, message, null);
}
/// <summary>
/// Logs a message object with the <c>FATAL</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>FATAL</c> level including
/// the stack trace of the <see cref="Exception"/> <paramref name="exception"/>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -