testss
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// -----------------------------------------------------------------------
|
||||
// <copyright file="ILog.cs" company="">
|
||||
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
|
||||
// </copyright>
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
namespace UnityEngine.U2D.Animation.TriangleNet
|
||||
.Logging
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
internal enum LogLevel
|
||||
{
|
||||
Info = 0,
|
||||
Warning = 1,
|
||||
Error = 2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A basic log interface.
|
||||
/// </summary>
|
||||
internal interface ILog<T> where T : ILogItem
|
||||
{
|
||||
void Add(T item);
|
||||
void Clear();
|
||||
|
||||
void Info(string message);
|
||||
void Error(string message, string info);
|
||||
void Warning(string message, string info);
|
||||
|
||||
IList<T> Data { get; }
|
||||
|
||||
LogLevel Level { get; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
// -----------------------------------------------------------------------
|
||||
// <copyright file="ILogItem.cs" company="">
|
||||
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
|
||||
// </copyright>
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
namespace UnityEngine.U2D.Animation.TriangleNet
|
||||
.Logging
|
||||
{
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// A basic log item interface.
|
||||
/// </summary>
|
||||
internal interface ILogItem
|
||||
{
|
||||
DateTime Time { get; }
|
||||
LogLevel Level { get; }
|
||||
string Message { get; }
|
||||
string Info { get; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,54 @@
|
||||
// -----------------------------------------------------------------------
|
||||
// <copyright file="SimpleLogItem.cs" company="">
|
||||
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
|
||||
// </copyright>
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
namespace UnityEngine.U2D.Animation.TriangleNet
|
||||
.Logging
|
||||
{
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an item stored in the log.
|
||||
/// </summary>
|
||||
internal class LogItem : ILogItem
|
||||
{
|
||||
DateTime time;
|
||||
LogLevel level;
|
||||
string message;
|
||||
string info;
|
||||
|
||||
public DateTime Time
|
||||
{
|
||||
get { return time; }
|
||||
}
|
||||
|
||||
public LogLevel Level
|
||||
{
|
||||
get { return level; }
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get { return message; }
|
||||
}
|
||||
|
||||
public string Info
|
||||
{
|
||||
get { return info; }
|
||||
}
|
||||
|
||||
public LogItem(LogLevel level, string message)
|
||||
: this(level, message, "")
|
||||
{}
|
||||
|
||||
public LogItem(LogLevel level, string message, string info)
|
||||
{
|
||||
this.time = DateTime.Now;
|
||||
this.level = level;
|
||||
this.message = message;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user