public void Log(InternalLogLevel level, string msg) { switch (level) { case InternalLogLevel.TRACE: this.Trace(msg); break; case InternalLogLevel.DEBUG: this.Debug(msg); break; case InternalLogLevel.INFO: this.Info(msg); break; case InternalLogLevel.WARN: this.Warn(msg); break; case InternalLogLevel.ERROR: this.Error(msg); break; default: throw new ArgumentOutOfRangeException(); } }
public void Log(InternalLogLevel level, string format, params object[] arguments) { switch (level) { case InternalLogLevel.TRACE: this.Trace(format, arguments); break; case InternalLogLevel.DEBUG: this.Debug(format, arguments); break; case InternalLogLevel.INFO: this.Info(format, arguments); break; case InternalLogLevel.WARN: this.Warn(format, arguments); break; case InternalLogLevel.ERROR: this.Error(format, arguments); break; default: throw new ArgumentOutOfRangeException(); } }
public void Log(InternalLogLevel level, string format, object argA, object argB) { switch (level) { case InternalLogLevel.TRACE: this.Trace(format, argA, argB); break; case InternalLogLevel.DEBUG: this.Debug(format, argA, argB); break; case InternalLogLevel.INFO: this.Info(format, argA, argB); break; case InternalLogLevel.WARN: this.Warn(format, argA, argB); break; case InternalLogLevel.ERROR: this.Error(format, argA, argB); break; default: ThrowHelper.ThrowArgumentOutOfRangeException(); break; } }
protected virtual void LogInternal(InternalLogLevel level, string message) { message = LeSignature + message; switch (level) { case InternalLogLevel.Debug: if (LogInternalDebug != null) { LogInternalDebug(message); } break; case InternalLogLevel.Info: if (LogInternalInfo != null) { LogInternalInfo(message); } break; case InternalLogLevel.Warn: if (LogInternalWarn != null) { LogInternalWarn(message); } break; case InternalLogLevel.Error: if (LogInternalError != null) { LogInternalError(message); } break; } if (m_Debug) { Debug.WriteLine(message); } }
public void Log(InternalLogLevel level, Exception cause) { switch (level) { case InternalLogLevel.TRACE: this.Trace(cause); break; case InternalLogLevel.DEBUG: this.Debug(cause); break; case InternalLogLevel.INFO: this.Info(cause); break; case InternalLogLevel.WARN: this.Warn(cause); break; case InternalLogLevel.ERROR: this.Error(cause); break; default: ThrowHelper.ThrowArgumentOutOfRangeException(); break; } }
/// <summary> /// Creates a new instance with the specified logger name. /// </summary> /// <param name="name">the name of the class to use for the logger</param> /// <param name="level">the log level</param> public XmppLoggingHandler(string name, LogLevel level) { Contract.Requires <ArgumentNullException>(name != null, $"{nameof(name)} cannot be null"); Logger = InternalLoggerFactory.GetInstance(name); Level = level; InternalLevel = level.ToInternalLevel(); }
private Http2FrameLogger(InternalLogLevel level, IInternalLogger logger) { if (logger is null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.logger); } _level = level; _logger = logger; }
/// <summary> /// Creates a new instance with the specified logger name. /// </summary> /// <param name="type">the class type to generate the logger for</param> /// <param name="level">the log level</param> public LoggingHandler(Type type, LogLevel level) { if (type == null) { throw new NullReferenceException("type"); } this.Logger = InternalLoggerFactory.GetInstance(type); this.Level = level; this.InternalLevel = level.ToInternalLevel(); }
/// <summary> /// Creates a new instance with the specified logger name. /// </summary> /// <param name="name">the name of the class to use for the logger</param> /// <param name="level">the log level</param> public LoggingHandler(string name, LogLevel level) { if (name == null) { throw new NullReferenceException("name"); } this.Logger = InternalLoggerFactory.GetInstance(name); this.Level = level; this.InternalLevel = level.ToInternalLevel(); }
/// <summary> /// Creates a new instance with the specified logger name. /// </summary> /// <param name="type">the class type to generate the logger for</param> /// <param name="level">the log level</param> /// <param name="bufferFormat">the ByteBuf format</param> public LoggingHandler(Type type, LogLevel level, ByteBufferFormat bufferFormat) { if (type is null) { ThrowHelper.ThrowNullReferenceException(ExceptionArgument.type); } Logger = InternalLoggerFactory.GetInstance(type); Level = level; InternalLevel = level.ToInternalLevel(); BufferFormat = bufferFormat; }
internal static void OnUnityLog(InternalLogLevel logLevel, IntPtr message, IntPtr parts) { try { OnUnityInternalLog?.Invoke(null, new UnityLogEventArgs { LogLevel = logLevel, Message = LibcHelper.Format(message, parts) }); } catch (Exception e) { File.WriteAllText($"unity_logger_err_{DateTime.Now.Ticks}.txt", e.ToString()); } }
public bool IsEnabled(InternalLogLevel level) { switch (level) { case InternalLogLevel.TRACE: return this.TraceEnabled; case InternalLogLevel.DEBUG: return this.DebugEnabled; case InternalLogLevel.INFO: return this.InfoEnabled; case InternalLogLevel.WARN: return this.WarnEnabled; case InternalLogLevel.ERROR: return this.ErrorEnabled; default: throw new ArgumentOutOfRangeException(); } }
public void Log(InternalLogLevel level, string msg) { switch (level) { case InternalLogLevel.TRACE: case InternalLogLevel.DEBUG: DebugUtility.LogVerbose(m_Name, msg); break; case InternalLogLevel.INFO: DebugUtility.Log(m_Name, msg); break; case InternalLogLevel.WARN: DebugUtility.LogWarning(m_Name, msg); break; case InternalLogLevel.ERROR: DebugUtility.LogError(m_Name, msg); break; } }
public void Log(InternalLogLevel level, string format, params object[] arguments) { switch (level) { case InternalLogLevel.TRACE: case InternalLogLevel.DEBUG: DebugUtility.LogVerbose(m_Name, MyStringFormat(format, arguments)); break; case InternalLogLevel.INFO: DebugUtility.Log(m_Name, MyStringFormat(format, arguments)); break; case InternalLogLevel.WARN: DebugUtility.LogWarning(m_Name, MyStringFormat(format, arguments)); break; case InternalLogLevel.ERROR: DebugUtility.LogError(m_Name, MyStringFormat(format, arguments)); break; } }
public void Log(InternalLogLevel level, string msg, Exception t) { switch (level) { case InternalLogLevel.TRACE: case InternalLogLevel.DEBUG: DebugUtility.LogVerbose(m_Name, $"{msg}\n{t.ToString()}"); break; case InternalLogLevel.INFO: DebugUtility.Log(m_Name, $"{msg}\n{t.ToString()}"); break; case InternalLogLevel.WARN: DebugUtility.LogWarning(m_Name, $"{msg}\n{t.ToString()}"); break; case InternalLogLevel.ERROR: DebugUtility.LogError(m_Name, $"{msg}\n{t.ToString()}"); break; } }
public bool IsEnabled(InternalLogLevel level) { switch (level) { case InternalLogLevel.TRACE: return(this.TraceEnabled); case InternalLogLevel.DEBUG: return(this.DebugEnabled); case InternalLogLevel.INFO: return(this.InfoEnabled); case InternalLogLevel.WARN: return(this.WarnEnabled); case InternalLogLevel.ERROR: return(this.ErrorEnabled); default: throw new ArgumentOutOfRangeException(); } }
public bool IsEnabled(InternalLogLevel level) { switch (level) { case InternalLogLevel.DEBUG: return(m_DebugEnabled); case InternalLogLevel.TRACE: return(m_TraceEnabled); case InternalLogLevel.INFO: return(m_InfoEnabled); case InternalLogLevel.WARN: return(m_WarnEnabled); case InternalLogLevel.ERROR: return(m_ErrorEnabled); default: return(false); } }
public Http2FrameLogger(InternalLogLevel level, Type type) : this(level, InternalLoggerFactory.GetInstance(type)) { }
public Http2FrameLogger(InternalLogLevel level, string name) : this(level, InternalLoggerFactory.GetInstance(name)) { }
public Http2FrameLogger(InternalLogLevel level) : this(level, InternalLoggerFactory.GetInstance <Http2FrameLogger>()) { }
public void Log(InternalLogLevel level, string format, params object[] arguments) { throw new NotImplementedException(); }
private void log(InternalLogLevel logLevel, object msg) { Logger.Log(logLevel, msg?.ToString()); }
/// <summary> /// Gets a value indicating whether logging is enabled for the specified level. /// </summary> /// <param name="level">Log level to be checked.</param> /// <returns>A value of <see langword="true" /> if logging is enabled for the specified level, otherwise it returns <see langword="false" />.</returns> private bool IsEnabled(LogLevels level) { return(InternalLogLevel.Has(level)); }
public bool IsEnabled(InternalLogLevel level) => true;
public void Log(InternalLogLevel level, Exception t) => Console.WriteLine("Log-level[" + level + "]: " + t);
public void Log(InternalLogLevel level, string msg, Exception t) => Console.WriteLine("Log-level[" + level + "]: " + msg + ", exception: " + t);
public void Log(InternalLogLevel level, string format, params object[] arguments) => Console.WriteLine("Log-level[" + level + "]: " + format, arguments);
public void Log(InternalLogLevel level, string format, object argA, object argB) => Console.WriteLine("Log-level[" + level + "]: " + format, argA, argB);
public override bool isEnabled(InternalLogLevel level) { return(level != InternalLogLevel.DEBUG || DebugEnabled); }
public void Log(InternalLogLevel level, Exception t) { throw new NotImplementedException(); }
public void Log(InternalLogLevel level, string msg) => Console.WriteLine("Log-level[" + level + "]: " + msg);