private void OnC2SGetLogLevelRequest(ServerLogMessage message)
        {
            LogNetSetting setting = new LogNetSetting();

            setting.GlobalSetting = new LogNetGlobalSetting()
            {
                GlobalLogLevel = LogUtil.GlobalLogLevel,
            };
            setting.LoggerSettings = new List <LogNetLoggerSetting>();
            foreach (var kvp in LogUtil.Loggers)
            {
                LogNetLoggerSetting loggerSetting = new LogNetLoggerSetting()
                {
                    Name               = kvp.Value.Name,
                    MinLogLevel        = kvp.Value.MinLogLevel,
                    StackTraceLogLevel = kvp.Value.StackTraceLogLevel,
                };
                setting.LoggerSettings.Add(loggerSetting);
            }

            string settingJsonStr = JsonConvert.SerializeObject(setting);

            m_ServerNetwork.SendMessage(message.Client, LogNetUtill.S2C_GET_LOG_LEVEL_RESPONSE, Encoding.UTF8.GetBytes(settingJsonStr));
        }
Exemple #2
0
 protected override void OutputLogMessage(LogLevel level, string message)
 {
     serverNetwork?.SendMessage(NetLogConst.S2C_LOG_MESSAGE_NOTIFY, Encoding.UTF8.GetBytes(message));
 }