using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using Common.Logging.Factory; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyFileVersion("3.4.0.0")] [assembly: TargetFramework(".NETStandard,Version=v1.0")] [assembly: CLSCompliant(true)] [assembly: AssemblyConfiguration("portable; release")] [assembly: AssemblyInformationalVersion("3.4.1; portable; release")] [assembly: AssemblyCompany("http://netcommon.sourceforge.net/")] [assembly: AssemblyCopyright("Copyright 2006-2011 the Common Infrastructure Libraries Team.")] [assembly: AssemblyTrademark("Apache License, Version 2.0")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyProduct("Common Logging Framework")] [assembly: SecurityTransparent] [assembly: AssemblyVersion("3.4.1.0")] namespace Common.Logging { public delegate string FormatMessageHandler(string format, params object[] args); public interface IConfigurationReader { object GetSection(string sectionName); } public interface ILog { bool IsTraceEnabled { get; } bool IsDebugEnabled { get; } bool IsErrorEnabled { get; } bool IsFatalEnabled { get; } bool IsInfoEnabled { get; } bool IsWarnEnabled { get; } IVariablesContext GlobalVariablesContext { get; } IVariablesContext ThreadVariablesContext { get; } INestedVariablesContext NestedThreadVariablesContext { get; } void Trace(object message); void Trace(object message, Exception exception); [StringFormatMethod("format")] void TraceFormat(string format, params object[] args); [StringFormatMethod("format")] void TraceFormat(string format, Exception exception, params object[] args); [StringFormatMethod("format")] void TraceFormat(IFormatProvider formatProvider, string format, params object[] args); [StringFormatMethod("format")] void TraceFormat(IFormatProvider formatProvider, string format, Exception exception, params object[] args); void Trace(Action formatMessageCallback); void Trace(Action formatMessageCallback, Exception exception); void Trace(IFormatProvider formatProvider, Action formatMessageCallback); void Trace(IFormatProvider formatProvider, Action formatMessageCallback, Exception exception); void Debug(object message); void Debug(object message, Exception exception); [StringFormatMethod("format")] void DebugFormat(string format, params object[] args); [StringFormatMethod("format")] void DebugFormat(string format, Exception exception, params object[] args); [StringFormatMethod("format")] void DebugFormat(IFormatProvider formatProvider, string format, params object[] args); [StringFormatMethod("format")] void DebugFormat(IFormatProvider formatProvider, string format, Exception exception, params object[] args); void Debug(Action formatMessageCallback); void Debug(Action formatMessageCallback, Exception exception); void Debug(IFormatProvider formatProvider, Action formatMessageCallback); void Debug(IFormatProvider formatProvider, Action formatMessageCallback, Exception exception); void Info(object message); void Info(object message, Exception exception); [StringFormatMethod("format")] void InfoFormat(string format, params object[] args); [StringFormatMethod("format")] void InfoFormat(string format, Exception exception, params object[] args); [StringFormatMethod("format")] void InfoFormat(IFormatProvider formatProvider, string format, params object[] args); [StringFormatMethod("format")] void InfoFormat(IFormatProvider formatProvider, string format, Exception exception, params object[] args); void Info(Action formatMessageCallback); void Info(Action formatMessageCallback, Exception exception); void Info(IFormatProvider formatProvider, Action formatMessageCallback); void Info(IFormatProvider formatProvider, Action formatMessageCallback, Exception exception); void Warn(object message); void Warn(object message, Exception exception); [StringFormatMethod("format")] void WarnFormat(string format, params object[] args); [StringFormatMethod("format")] void WarnFormat(string format, Exception exception, params object[] args); [StringFormatMethod("format")] void WarnFormat(IFormatProvider formatProvider, string format, params object[] args); [StringFormatMethod("format")] void WarnFormat(IFormatProvider formatProvider, string format, Exception exception, params object[] args); void Warn(Action formatMessageCallback); void Warn(Action formatMessageCallback, Exception exception); void Warn(IFormatProvider formatProvider, Action formatMessageCallback); void Warn(IFormatProvider formatProvider, Action formatMessageCallback, Exception exception); void Error(object message); void Error(object message, Exception exception); [StringFormatMethod("format")] void ErrorFormat(string format, params object[] args); [StringFormatMethod("format")] void ErrorFormat(string format, Exception exception, params object[] args); [StringFormatMethod("format")] void ErrorFormat(IFormatProvider formatProvider, string format, params object[] args); [StringFormatMethod("format")] void ErrorFormat(IFormatProvider formatProvider, string format, Exception exception, params object[] args); void Error(Action formatMessageCallback); void Error(Action formatMessageCallback, Exception exception); void Error(IFormatProvider formatProvider, Action formatMessageCallback); void Error(IFormatProvider formatProvider, Action formatMessageCallback, Exception exception); void Fatal(object message); void Fatal(object message, Exception exception); [StringFormatMethod("format")] void FatalFormat(string format, params object[] args); [StringFormatMethod("format")] void FatalFormat(string format, Exception exception, params object[] args); [StringFormatMethod("format")] void FatalFormat(IFormatProvider formatProvider, string format, params object[] args); [StringFormatMethod("format")] void FatalFormat(IFormatProvider formatProvider, string format, Exception exception, params object[] args); void Fatal(Action formatMessageCallback); void Fatal(Action formatMessageCallback, Exception exception); void Fatal(IFormatProvider formatProvider, Action formatMessageCallback); void Fatal(IFormatProvider formatProvider, Action formatMessageCallback, Exception exception); } public interface ILoggerFactoryAdapter { ILog GetLogger(Type type); ILog GetLogger(string key); } public interface ILogManager { string COMMON_LOGGING_SECTION { get; } IConfigurationReader ConfigurationReader { get; } ILoggerFactoryAdapter Adapter { get; set; } void Reset(); void Reset(IConfigurationReader reader); [MethodImpl(MethodImplOptions.NoInlining)] [Obsolete("Null-Reference Exception when dealing with Dynamic Types, Prefer instead one of the LogManager.GetLogger(...) variants.")] ILog GetCurrentClassLogger(); ILog GetLogger(); ILog GetLogger(Type type); ILog GetLogger(string key); } public interface INestedVariablesContext { bool HasItems { get; } IDisposable Push(string text); string Pop(); void Clear(); } public interface IVariablesContext { void Set(string key, object value); object Get(string key); bool Contains(string key); void Remove(string key); void Clear(); } [Flags] public enum LogLevel { All = 0, Trace = 1, Debug = 2, Info = 4, Warn = 8, Error = 0x10, Fatal = 0x20, Off = 0x40 } } namespace Common.Logging.Factory { [AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public sealed class StringFormatMethodAttribute : Attribute { public string FormatParameterName { get; private set; } public StringFormatMethodAttribute(string formatParameterName) { FormatParameterName = formatParameterName; } } }