日志通用代码
/// <summary> /// /// </summary> /// <param name="node">信息节点,报告,撤回,签收等</param> /// <param name="action">信息动作,请求,返回,查询</param> /// <param name="ret">信息</param> /// <param name="level">0-debug,1-info,2-warn,3-error</param> private void logTapTap(string node, string action, string ret, int level) { if (1 == level) { Logger.Info(node + "<===>" + action + "<===>" + ret); } if (2 == level) { Logger.Warn(node + "<===>" + action + "<===>" + ret); } if (3 == level) { Logger.Error(node + "<===>" + action + "<===>" + ret); } if (0 == level) { Logger.Debug(node + "<===>" + action + "<===>" + ret); } }
标准
node直接使用中文或者英文都可,每个方法内,node会保持不变
public static string MessageInputNode = "三方调用"; public static string GetOutApplyInfoNode = "门诊申请"; public static string CardConvertPatIdNode = "卡号转换"; public static string GetOrderByOLDLISNode = "读老lis信息"; public static string GetInPatientApplyInfoNode = "住院申请"; public static string GetSampleBySignNewNode = "签收标本分支"; public static string SignSampleNode = "签收标本"; public static string LabChargedNode = "计费"; public static string SyncPatinfoNode = "读三方病人信息"; public static string GetPatientInfoNode = "读病人信息"; public static string ReturnsFeeRequestNode = "退费"; public static string NotifyPlatformSpecimenStatusNode = "推进三方标本状态"; public static string ReceiveAuditNode = "普通报告"; public static string ReceiveQueCritToHisNode = "危报告";
如:住院申请,门诊申请
action 所有入口处 使用begin , 结束使用end, catch到报错使用error,空指针用 null
1 别人调用我们入口日志,
logTapTap("三方调用","begin", JsonConvert.SerializeObject(ipnut), 1);
标签:node,string,level,fzq,打印,static,action,日志,public From: https://www.cnblogs.com/woainixxx/p/16736561.html