AxiosEngine-old 

AxiosEngine-old Mercurial Source Tree


Root/axios/Engine/Log/AxiosLog.cs

using System;
using System.Collections.Generic;
 
 
namespace Axios.Engine.Log
{
    [Flags]
    public enum LoggingFlag
    {
        NONE = 0,
        DEBUG = 1,
        INFO = 2,
        WARN = 4,
        ERROR = 8,
        FATAL = 16,
        ALL = 32
    }
    public class AxiosLog : Singleton<AxiosLog>
    {
        private List<string> _log;
 
        public AxiosLog()
        {
            _log = new List<string>();
        }
 
        public void AddLine(string line, LoggingFlag flag)
        {
             
            if (flag <= Settings.Loglevel)
                _log.Add("[" + DateTime.Now.ToString("M/d/yyyy H:mm:ss") + " - " + flag.ToString() + "]" + line);
        }
 
        public List<string> GetLogList()
        {
            return _log;
        }
 
        public string GetLog(string seperator)
        {
            return String.Join(seperator, _log.ToArray()) + seperator;
        }
 
        public string GetLog()
        {
            return GetLog("\r\n");
        }
    }
}
Source at commit 7f019dae1ee8 created 12 years 8 months ago.
By nathan@daedalus, Commiting before merge

Archive Download this file

Page rendered in 0.85858s using 11 queries.