/// <summary> /// Preparing correct message to log /// </summary> /// <param name="dto">Client info to logging</param> /// <returns>message with basic information to log</returns> private string PrepareMessage(LogDTO dto) { string message = string.Empty; if (!string.IsNullOrEmpty(dto.Message)) { message += dto.Message; } if (!string.IsNullOrEmpty(dto.Function)) { message = dto.Function + (dto.Function.EndsWith(")") ? "" : "()") + "|" + message; } if (!string.IsNullOrEmpty(dto.Module)) { message = dto.Module + "|" + message; } message = GetClientEndpoint() + "|" + message; return(message); }
/// <summary> /// Add trace log /// </summary> /// <param name="dto">Client info to logging</param> public void Trace(LogDTO dto) { string message = PrepareMessage(dto); _logger.Trace(message); }
/// <summary> /// Add info log /// </summary> /// <param name="dto">Client info to logging</param> public void Info(LogDTO dto) { string message = PrepareMessage(dto); _logger.Info(message); }
/// <summary> /// Add fatal log /// </summary> /// <param name="dto">Client info to logging</param> public void Fatal(LogDTO dto) { string message = PrepareMessage(dto); _logger.Fatal(message); }
/// <summary> /// Add error log /// </summary> /// <param name="dto">Client info to logging</param> public void Error(LogDTO dto) { string message = PrepareMessage(dto); _logger.Error(message); }
/// <summary> /// Add debug log /// </summary> /// <param name="dto">Client info to logging</param> public void Debug(LogDTO dto) { string message = PrepareMessage(dto); _logger.Debug(message); }
/// <summary> /// Add warn log /// </summary> /// <param name="dto">Client info to logging</param> public void Warn(LogDTO dto) { string message = PrepareMessage(dto); _logger.Warn(message); }