智慧建筑第三方功能集成微服务,目的是聚集所有涉及到第三方厂商调用的功能,按照业务功能划分不同微服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

35 lines
1001 B

using System;
using System.Collections.Generic;
using System.Text;
namespace WeiCloud.Core.BaseModels
{
public class LoggerWarp
{
private readonly string _actionName;
private readonly string _message;
private readonly Exception _ex;
public LoggerWarp(string actionName, string message = "", Exception ex = null)
{
_actionName = actionName;
_message = message;
_ex = ex;
}
public string GetMessage()
{
StringBuilder messageString = new StringBuilder();
messageString.Append(_actionName).Append("|");
if (!string.IsNullOrEmpty(_message))
{
messageString.Append(_message).Append("|");
}
if (_ex != null)
{
messageString.Append($"抛出了异常信息:{_ex.Message} {_ex.StackTrace} {_ex.Source}");
}
return messageString.ToString();
}
}
}