コード例 #1
0
 public bool Flush(LoggerInformation loggerInformation)
 {
     byte[] writeInfo = Encoding.Default.GetBytes(loggerInformation.GetLoggerStringMessage());
     fileStream.Write(writeInfo, 0, writeInfo.Length);
     fileStream.Flush();
     return(true);
 }
コード例 #2
0
        public async Task <bool> FlushAsync(LoggerInformation loggerInformation)
        {
            byte[] writeInfo = Encoding.Default.GetBytes(loggerInformation.GetLoggerStringMessage());
            fileStream.Write(writeInfo, 0, writeInfo.Length);
            await fileStream.FlushAsync();

            return(true);
        }
コード例 #3
0
        public async Task <bool> FlushAsync(LoggerInformation loggerInformation)
        {
            byte[]     writeInfo = Encoding.Default.GetBytes(loggerInformation.GetLoggerStringMessage());
            IPEndPoint server    = new IPEndPoint(IPAddress.Parse(serverIp), serverPort);

            UDP_Client.Send(writeInfo, writeInfo.Length, server);
            return(true);
        }
コード例 #4
0
 public void Log(LoggerInformation loggerInformation)
 {
     if (loggerInfoList.Count == bufferLimit)
     {
         ThreadPool.QueueUserWorkItem(LoggersFlush, new ThreadInformation
         {
             threadInfoList = loggerInfoList,
             threadNumber   = buffersCount++
         });
         loggerInfoList = new List <LoggerInformation>();
     }
     loggerInfoList.Add(loggerInformation);
 }