svn merge http://svn.tommymontgomery.com/SimpleLog/trunk http://svn.tommymontgomery.com/SimpleLog/branches/1.1
67 lines
1.4 KiB
C#
67 lines
1.4 KiB
C#
using System;
|
|
|
|
namespace SimpleLog.Framework {
|
|
|
|
/// <summary>
|
|
/// Log level enumeration
|
|
/// </summary>
|
|
[Flags]
|
|
public enum LogLevel {
|
|
/// <summary>
|
|
/// Debug message
|
|
/// </summary>
|
|
Debug = 1,
|
|
/// <summary>
|
|
/// Informational message
|
|
/// </summary>
|
|
Info = 2,
|
|
/// <summary>
|
|
/// Warning message
|
|
/// </summary>
|
|
Warning = 3,
|
|
/// <summary>
|
|
/// Error message
|
|
/// </summary>
|
|
Error = 4,
|
|
/// <summary>
|
|
/// Critical death message
|
|
/// </summary>
|
|
Critical = 5
|
|
}
|
|
|
|
/// <summary>
|
|
/// Struct representing the different line terminators
|
|
/// </summary>
|
|
public struct LineTerminator {
|
|
/// <summary>
|
|
/// Windows line terminator (CRLF)
|
|
/// </summary>
|
|
public static readonly string Windows = "\r\n";
|
|
/// <summary>
|
|
/// Macintosh line terminator (CR)
|
|
/// </summary>
|
|
public static readonly string Mac = "\r";
|
|
/// <summary>
|
|
/// Unix line terminator (LF)
|
|
/// </summary>
|
|
public static readonly string Unix = "\n";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Utility class
|
|
/// </summary>
|
|
public static class Util {
|
|
|
|
/// <summary>
|
|
/// Determines whether the given line terminator is a valid line terminator
|
|
/// </summary>
|
|
public static bool LineTerminatorIsValid(string lineTerminator) {
|
|
return
|
|
lineTerminator == LineTerminator.Unix ||
|
|
lineTerminator == LineTerminator.Windows ||
|
|
lineTerminator == LineTerminator.Mac;
|
|
}
|
|
|
|
}
|
|
}
|