axiosengine/axios/Engine/Log/AxiosLog.cs
nathan@daedalus 7d3c8a9f39 + * - Adding properties in DrawableAxiosGameObject to turn on/off the following:
+ *   - AdjustUnits
+ *   - RelativeToCamera
+ * - Cleaning and sorting using statements
2012-03-24 18:06:51 -05:00

50 lines
1.0 KiB
C#

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");
}
}
}