using IStation.Untity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IStation.DataDockingSocket
{
///
/// 生成调试信息辅助类
///
internal class LogCustomHelper
{
private const string _logNameDebug = "socket-zjs-debug";
///
/// 生成调试信息辅助类
///
public static void Debug(List rece_list)
{
if (rece_list == null || rece_list.Count < 1)
return;
var json = JsonHelper.Object2Json(rece_list);
LogHelper.Custom(_logNameDebug, json);
}
///
/// 生成调试信息辅助类
///
public static void Debug(List rece_list)
{
if (rece_list == null || rece_list.Count < 1)
return;
var json = JsonHelper.Object2Json(rece_list);
LogHelper.Custom(_logNameDebug, json);
}
public static void Debug(string msg)
{
LogHelper.Custom(_logNameDebug, msg);
}
private const string _logNameSrc = "socket-zjs-src";
///
/// 生成
///
public static void Src(byte[] bts)
{
if (bts == null || bts.Count() < 1)
return;
var message_bts = BitTransfer.ToString(bts);
LogHelper.Custom(_logNameSrc, message_bts);
}
private const string _logNameInfo = "socket-zjs-info";
///
/// 生成
///
public static void Info(string msg)
{
if (string.IsNullOrEmpty(msg))
return;
LogHelper.Custom(_logNameInfo, msg);
}
private const string _logNameError = "socket-zjs-error";
///
/// 生成
///
public static void Error(string msg, Exception ex = null)
{
if (string.IsNullOrEmpty(msg))
return;
if (ex == null)
LogHelper.Custom(_logNameError, msg);
else
LogHelper.Custom(_logNameError, string.Format("msg:{0}, ex:{1}", msg, ex.StackTrace));
}
}
}