/// <summary> /// Writes the specified log to the file /// </summary> /// <param name="log"></param> public void Write(LogMessage log) { m_tmpStream.Position = 0; m_tmpStream.Write(true); log.Save(m_tmpStream, m_saveHelper); long length = m_tmpStream.Position; m_tmpStream.Position = 0; m_tmpStream.CopyTo(m_zipStream, length, m_tmpBuffer); if (log.Level >= MessageLevel.Info) { m_zipStream.Flush(); } m_logCount++; }
/// <summary> /// Writes the specified log to the file /// </summary> /// <param name="log"></param> /// <param name="autoFlush"></param> public void Write(LogMessage log, bool autoFlush = true) { try { m_tmpStream.Position = 0; m_tmpStream.Write(true); log.Save(m_tmpStream, m_saveHelper); long length = m_tmpStream.Position; m_tmpStream.Position = 0; m_tmpStream.CopyTo(m_zipStream, length, m_tmpBuffer); if (log.Level >= MessageLevel.Info && autoFlush) { m_zipStream.Flush(); } m_logCount++; } catch (Exception) { throw; } }