SuperSocket 日志接口
SuperSocket的日志功能非常简单,你几乎可以在任何地方都能记录日志。 AppServer 和 AppSession 都有Logger属性, 你可以直接用它来记录日志。
以下代码演示了日志接口的使用:
A -
/// <summary>
/// PolicyServer base class
/// </summary>
public abstract class PolicyServer : AppServer<PolicySession, BinaryRequestInfo>
{
......
/// <summary>
/// Setups the specified root config.
/// </summary>
/// <param name="rootConfig">The root config.</param>
/// <param name="config">The config.</param>
/// <returns></returns>
protected override bool Setup(IRootConfig rootConfig, IServerConfig config)
{
m_PolicyFile = config.Options.GetValue("policyFile");
if (string.IsNullOrEmpty(m_PolicyFile))
{
if(Logger.IsErrorEnabled)
Logger.Error("Configuration option policyFile is required!");
return false;
}
return true;
}
......
}
B -
public class RemoteProcessSession : AppSession<RemoteProcessSession>
{
protected override void HandleUnknownRequest(StringRequestInfo requestInfo)
{
Logger.Error("Unknow request");
}
}
相关文章
- DLL封装Interface(接口)(D2007+win764位)
- 使用阿里云身份证扫描识别接口案例——CSDN博客
- 从零开始入门 K8s | 理解容器运行时接口 CRI
- comparator接口与Comparable接口的区别
- Atitit 项目通讯接口方案attilax总结.docx
- 使用 淘宝 接口,根据公网ip 获取地理信息
- Python编程:通过百度地图接口抓取机构的地址和电话信息
- 【一天一门编程语言】用 Go 语言实现一个 DAG 任务调度系统的API 接口代码
- 玩转华为ENSP模拟器系列 | 配置Dot1q终结子接口接入L2示例
- Python接口自动化核心模块 - 数据库操作和日志
- 5年测试工程师浅谈—— 你完全了解接口测试么?
- 利用Jmeter做接口测试(功能测试)全流程分析
- 【保姆级教程】手把手教你打造一个可视化接口自动化测试系统
- Spring Boot从入门到实战:集成AOPLog来记录接口访问日志
- List<?> list= new ArrayList<?>接口引用指向实现类的对象.
- JMeter 接口测试/并发测试/性能测试