using System.Diagnostics;
using UnityEngine;
namespace Ubisoft
{
public partial class HtLogger
{
///
/// This class is responsible for logging messages to a specific channel.
/// You can use channels to keep your logs organized. You can enable/disable channels to reduce noise while debugging a given feature.
///
public class Channel
{
private HtLogger Logger { get; set; }
public string Name { get; set; }
public string Color { get; set; }
public bool IsEnabled { get; set; }
public bool IsTagEnabled { get; set; } = true;
protected Channel()
{
}
///
/// Create a Channel.
///
/// Logger where the messages of this channel need to be logged to.
/// Name of the channel. It's also used as a tag for the message.
/// Color to use for the message. Two options:
/// 1)A string containing a hexadecimal value (i.e. "#FF5733")
/// 2)A string containing one of the defualt values defined in UnityEngine.Color (i.e. "magenta")
///
internal Channel(HtLogger logger, string name, string color = null)
{
Setup(logger, name, color);
}
private void Setup(HtLogger logger, string name, string color = null)
{
Logger = logger;
Name = name;
Color = color;
IsEnabled = true;
}
//
// Assert
//
///
/// Assert a condition and log a generic error message to all Logger streams on failure.
///
/// Note that this method works only if LoggerProperty.IsAssertEnabled is enabled. Otherwise this method and the calls to this method will be
/// stripped out avoiding all impact in performance and build size.
///
///
/// Condition you expect to be true.
[Conditional(HT_LOGGER_ASSERT_ON)]
public void Assert(bool condition)
{
Logger.Assert(condition);
}
//
// Log
//
///
/// Log a Trace message to this channel for all Logger streams.
///
/// Trace logs contain the most detailed messages. These messages may contain sensitive application data.
/// These messages are disabled by default and should never be enabled in a production environment.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Trace. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
[Conditional(HT_LOGGER_TRACE_ON)]
public void LogTrace(object message)
{
Logger.InternalLog(this, message, ELogLevel.Trace);
}
///
/// Log a Debug message to this channel for all Logger streams.
///
/// Debug logs are used for interactive investigation during development. These logs should primarily contain information useful
/// for debugging and have no long-term value.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Debug or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
[Conditional(HT_LOGGER_DEBUG_ON)]
public void LogDebug(object message)
{
Logger.InternalLog(this, message, ELogLevel.Debug);
}
///
/// Log an Information message to this channel for all Logger streams.
///
/// Information logs track the general flow of the application (breadcrumbs). These logs should have long-term value.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Information or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
[Conditional(HT_LOGGER_INFORMATION_ON)]
public void LogInformation(object message)
{
Logger.InternalLog(this, message, ELogLevel.Information);
}
///
/// Log a Warning message to this channel for all Logger streams.
///
/// Warning logs highlight an abnormal or unexpected event in the application flow, but do not otherwise cause the application execution to stop.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Warning or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Yellow is always used for Warning messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
[Conditional(HT_LOGGER_WARNING_ON)]
public void LogWarning(object message)
{
Logger.InternalLog(this, message, ELogLevel.Warning);
}
///
/// Log an Error message to this channel for all Logger streams.
///
/// Error logs highlight when the current flow of execution is stopped due to a failure. These should indicate a failure in the current activity, not an application-wide failure.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Error or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Error messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
[Conditional(HT_LOGGER_ERROR_ON)]
public void LogError(object message)
{
Logger.InternalLog(this, message, ELogLevel.Error);
}
///
/// Log a Critical message to this channel for all Logger streams.
///
/// Critical logs describe an unrecoverable application or system crash, or a catastrophic failure that requires immediate attention.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Critical or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Critical messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
[Conditional(HT_LOGGER_CRITICAL_ON)]
public void LogCritical(object message)
{
Logger.InternalLog(this, message, ELogLevel.Critical);
}
///
/// Assert a condition and log an error message to this channel for all Logger streams on failure.
///
/// Note that this method works only if LoggerProperty.IsAssertEnabled is enabled. Otherwise this method and the calls to this method will be
/// stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Assertions.
///
///
/// Condition you expect to be true.
/// Message to log.
[Conditional(HT_LOGGER_ASSERT_ON)]
public void Assert(bool condition, object message)
{
Logger.InternalAssert(this, condition, message, null);
}
///
/// Log an assertion message to this channel for all Logger streams.
///
/// Note that this method works only if LoggerProperty.IsAssertEnabled is enabled. Otherwise this method and the calls to this method will be
/// stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Assertions.
///
///
/// Message to log.
[Conditional(HT_LOGGER_ASSERT_ON)]
public void LogAssertion(object message)
{
Logger.InternalLogAssertion(this, message, null);
}
//
// Log with context
//
///
/// Log a Trace message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Trace logs contain the most detailed messages. These messages may contain sensitive application data.
/// These messages are disabled by default and should never be enabled in a production environment.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Trace. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
/// Object to which the message applies.
[Conditional(HT_LOGGER_TRACE_ON)]
public void LogTrace(object message, Object context)
{
Logger.InternalLog(this, message, ELogLevel.Trace, context);
}
///
/// Log a Debug message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Debug logs are used for interactive investigation during development. These logs should primarily contain information useful
/// for debugging and have no long-term value.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Debug or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
/// Object to which the message applies.
[Conditional(HT_LOGGER_DEBUG_ON)]
public void LogDebug(object message, Object context)
{
Logger.InternalLog(this, message, ELogLevel.Debug, context);
}
///
/// Log an Information message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Information logs track the general flow of the application (breadcrumbs). These logs should have long-term value.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Information or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
/// Object to which the message applies.
[Conditional(HT_LOGGER_INFORMATION_ON)]
public void LogInformation(object message, Object context)
{
Logger.InternalLog(this, message, ELogLevel.Information, context);
}
///
/// Log a Warning message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Warning logs highlight an abnormal or unexpected event in the application flow, but do not otherwise cause the application execution to stop.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Warning or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Yellow is always used for Warning messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
/// Object to which the message applies.
[Conditional(HT_LOGGER_WARNING_ON)]
public void LogWarning(object message, Object context)
{
Logger.InternalLog(this, message, ELogLevel.Warning, context);
}
///
/// Log an Error message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Error logs highlight when the current flow of execution is stopped due to a failure. These should indicate a failure in the current activity, not an application-wide failure.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Error or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Error messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
/// Object to which the message applies.
[Conditional(HT_LOGGER_ERROR_ON)]
public void LogError(object message, Object context)
{
Logger.InternalLog(this, message, ELogLevel.Error, context);
}
///
/// Log a Critical message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Critical logs describe an unrecoverable application or system crash, or a catastrophic failure that requires immediate attention.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Critical or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Critical messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Message to log.
/// Object to which the message applies.
[Conditional(HT_LOGGER_CRITICAL_ON)]
public void LogCritical(object message, Object context)
{
Logger.InternalLog(this, message, ELogLevel.Critical, context);
}
///
/// Assert a condition, log an error message to this channel for all Logger streams on failure and highlight in the hierarchy the object that the message applies to.
///
/// Note that this method works only if LoggerProperty.IsAssertEnabled is enabled. Otherwise this method and the calls to this method will be
/// stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Assertions.
///
///
/// Condition you expect to be true.
/// Message to log.
/// Object to which the message applies.
[Conditional(HT_LOGGER_ASSERT_ON)]
public void Assert(bool condition, object message, Object context)
{
Logger.InternalAssert(this, condition, message, context);
}
///
/// Log an assertion message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Note that this method works only if LoggerProperty.IsAssertEnabled is enabled. Otherwise this method and the calls to this method will be
/// stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Assertions.
///
///
/// Message to log.
/// Object to which the message applies.
[Conditional(HT_LOGGER_ASSERT_ON)]
public void LogAssertion(object message, Object context)
{
Logger.InternalLogAssertion(this, message, context);
}
//
// Log with format
//
///
/// Log a formated Trace message to this channel for all Logger streams.
///
/// Trace logs contain the most detailed messages. These messages may contain sensitive application data.
/// These messages are disabled by default and should never be enabled in a production environment.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Trace. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_TRACE_ON)]
public void LogTraceFormat(string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Trace);
}
///
/// Log a formatted Debug message to this channel for all Logger streams.
///
/// Debug logs are used for interactive investigation during development. These logs should primarily contain information useful
/// for debugging and have no long-term value.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Debug or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_DEBUG_ON)]
public void LogDebugFormat(string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Debug);
}
///
/// Log a formatted Information message to this channel for all Logger streams.
///
/// Information logs track the general flow of the application (breadcrumbs). These logs should have long-term value.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Information or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_INFORMATION_ON)]
public void LogInformationFormat(string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Information);
}
///
/// Log a formatted Warning message to this channel for all Logger streams.
///
/// Warning logs highlight an abnormal or unexpected event in the application flow, but do not otherwise cause the application execution to stop.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Warning or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Yellow is always used for Warning messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_WARNING_ON)]
public void LogWarningFormat(string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Warning);
}
///
/// Log a formatted Error message to this channel for all Logger streams.
///
/// Error logs highlight when the current flow of execution is stopped due to a failure. These should indicate a failure in the current activity, not an application-wide failure.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Error or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Error messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_ERROR_ON)]
public void LogErrorFormat(string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Error);
}
///
/// Log a formatted Critical message to this channel for all Logger streams.
///
/// Critical logs describe an unrecoverable application or system crash, or a catastrophic failure that requires immediate attention.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Critical or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Critical messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_CRITICAL_ON)]
public void LogCriticalFormat(string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Critical);
}
///
/// Assert a condition and log a formatted error message to this channel for all Logger streams on failure.
///
/// Note that this method works only if LoggerProperty.IsAssertEnabled is enabled. Otherwise this method and the calls to this method will be
/// stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Assertions.
///
///
/// Condition you expect to be true.
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_ASSERT_ON)]
public void AssertFormat(bool condition, string format, params object[] args)
{
Logger.InternalAssert(this, condition, string.Format(format, args), null);
}
///
/// Log a formatted assertion message to this channel for all Logger streams.
///
/// Note that this method works only if LoggerProperty.IsAssertEnabled is enabled. Otherwise this method and the calls to this method will be
/// stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Assertions.
///
///
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_ASSERT_ON)]
public void LogAssertionFormat(string format, params object[] args)
{
Logger.InternalLogAssertion(this, string.Format(format, args), null);
}
//
// Log with context and format
//
///
/// Log a formated Trace message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Trace logs contain the most detailed messages. These messages may contain sensitive application data.
/// These messages are disabled by default and should never be enabled in a production environment.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Trace. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Object to which the message applies.
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_TRACE_ON)]
public void LogTraceFormat(Object context, string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Trace, context);
}
///
/// Log a formatted Debug message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Debug logs are used for interactive investigation during development. These logs should primarily contain information useful
/// for debugging and have no long-term value.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Debug or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Object to which the message applies.
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_DEBUG_ON)]
public void LogDebugFormat(Object context, string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Debug, context);
}
///
/// Log a formatted Information message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Information logs track the general flow of the application (breadcrumbs). These logs should have long-term value.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Information or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Object to which the message applies.
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_INFORMATION_ON)]
public void LogInformationFormat(Object context, string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Information, context);
}
///
/// Log a formatted Warning message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Warning logs highlight an abnormal or unexpected event in the application flow, but do not otherwise cause the application execution to stop.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Warning or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Yellow is always used for Warning messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Object to which the message applies.
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_WARNING_ON)]
public void LogWarningFormat(Object context, string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Warning, context);
}
///
/// Log a formatted Error message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Error logs highlight when the current flow of execution is stopped due to a failure. These should indicate a failure in the current activity, not an application-wide failure.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Error or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Error messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Object to which the message applies.
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_ERROR_ON)]
public void LogErrorFormat(Object context, string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Error, context);
}
///
/// Log a formatted Critical message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Critical logs describe an unrecoverable application or system crash, or a catastrophic failure that requires immediate attention.
///
/// Note that this method works only if LoggerProperty.MinLogLevel is ELogLevel.Critical or less. Otherwise this method and the calls to
/// this method will be stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Critical messages.
///
/// More information on deciding the log level to use here:
/// https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loglevel?view=dotnet-plat-ext-5.0
///
/// Object to which the message applies.
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_CRITICAL_ON)]
public void LogCriticalFormat(Object context, string format, params object[] args)
{
Logger.InternalLog(this, string.Format(format, args), ELogLevel.Critical, context);
}
///
/// Assert a condition, log a formatted error message to this channel for all Logger streams on failure and highlight in the hierarchy the object that the message applies to.
///
/// Note that this method works only if LoggerProperty.IsAssertEnabled is enabled. Otherwise this method and the calls to this method will be
/// stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Assertions.
///
///
/// Condition you expect to be true.
/// Object to which the message applies.
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_ASSERT_ON)]
public void AssertFormat(bool condition, Object context, string format, params object[] args)
{
Logger.InternalAssert(this, condition, string.Format(format, args), context);
}
///
/// Log a formatted assertion message to this channel for all Logger streams and highlight in the hierarchy the object that the message applies to.
///
/// Note that this method works only if LoggerProperty.IsAssertEnabled is enabled. Otherwise this method and the calls to this method will be
/// stripped out avoiding all impact in performance and build size.
///
/// Channel color is ignored. Red is always used for Assertions.
///
///
/// Object to which the message applies.
/// A composite format string.
/// Format arguments.
[Conditional(HT_LOGGER_ASSERT_ON)]
public void LogAssertionFormat(Object context, string format, params object[] args)
{
Logger.InternalLogAssertion(this, string.Format(format, args), context);
}
}
}
}