Modified LogLevel enum values to PascalCase values

This commit is contained in:
sta 2014-03-02 22:15:41 +09:00
parent fc548650c2
commit bb8d4c25ba
10 changed files with 42 additions and 42 deletions

View File

@ -111,7 +111,7 @@ namespace Example {
};
#if DEBUG
ws.Log.Level = LogLevel.TRACE;
ws.Log.Level = LogLevel.Trace;
#endif
//ws.Compression = CompressionMethod.DEFLATE;
//ws.Origin = "http://echo.websocket.org";

View File

@ -73,7 +73,7 @@ namespace Example1
private void configure()
{
#if DEBUG
_ws.Log.Level = LogLevel.TRACE;
_ws.Log.Level = LogLevel.Trace;
#endif
_ws.OnOpen += (sender, e) =>
{

View File

@ -17,7 +17,7 @@ namespace Example2
//var wssv = new WebSocketServer ("wss://localhost:4649"); // Secure
#if DEBUG
wssv.Log.Level = LogLevel.TRACE;
wssv.Log.Level = LogLevel.Trace;
#endif
/* Secure Connection

View File

@ -17,7 +17,7 @@ namespace Example3
//_httpsv = new HttpServer (4649, true) // Secure;
#if DEBUG
_httpsv.Log.Level = LogLevel.TRACE;
_httpsv.Log.Level = LogLevel.Trace;
#endif
/* Secure Connection

View File

@ -468,15 +468,15 @@ The `WebSocket` class includes the own logging function.
You can access it with the `WebSocket.Log` property (returns a `WebSocketSharp.Logger`).
So if you would like to change the current logging level (`WebSocketSharp.LogLevel.ERROR` as the default), you should set the `WebSocket.Log.Level` property to any of the `LogLevel` enum values.
So if you would like to change the current logging level (`WebSocketSharp.LogLevel.Error` as the default), you should set the `WebSocket.Log.Level` property to any of the `LogLevel` enum values.
```cs
ws.Log.Level = LogLevel.DEBUG;
ws.Log.Level = LogLevel.Debug;
```
This means a log with less than `LogLevel.DEBUG` cannot be outputted.
This means a log with less than `LogLevel.Debug` cannot be outputted.
And if you would like to output a log, you should use any of the output methods. The following outputs a log with `LogLevel.DEBUG`.
And if you would like to output a log, you should use any of the output methods. The following outputs a log with `LogLevel.Debug`.
```cs
ws.Log.Debug ("This is a debug message.");

View File

@ -4,8 +4,8 @@
*
* The MIT License
*
* Copyright (c) 2013 sta.blockhead
*
* Copyright (c) 2013-2014 sta.blockhead
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@ -15,7 +15,7 @@
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -31,33 +31,33 @@ using System;
namespace WebSocketSharp
{
/// <summary>
/// Contains the values of the logging level.
/// Contains the values of the logging levels.
/// </summary>
public enum LogLevel
{
/// <summary>
/// Indicates the bottom logging level.
/// </summary>
TRACE,
Trace,
/// <summary>
/// Indicates the 2nd logging level from the bottom.
/// </summary>
DEBUG,
Debug,
/// <summary>
/// Indicates the 3rd logging level from the bottom.
/// </summary>
INFO,
Info,
/// <summary>
/// Indicates the 3rd logging level from the top.
/// </summary>
WARN,
Warn,
/// <summary>
/// Indicates the 2nd logging level from the top.
/// </summary>
ERROR,
Error,
/// <summary>
/// Indicates the top logging level.
/// </summary>
FATAL
Fatal
}
}

View File

@ -68,11 +68,11 @@ namespace WebSocketSharp
/// Initializes a new instance of the <see cref="Logger"/> class.
/// </summary>
/// <remarks>
/// This constructor initializes the current logging level with the <see cref="LogLevel.ERROR"/> and
/// This constructor initializes the current logging level with the <see cref="LogLevel.Error"/> and
/// initializes the path to the log file with <see langword="null"/>.
/// </remarks>
public Logger ()
: this (LogLevel.ERROR, null, null)
: this (LogLevel.Error, null, null)
{
}
@ -184,7 +184,7 @@ namespace WebSocketSharp
_output (data, _file);
}
catch (Exception ex) {
data = new LogData (LogLevel.FATAL, new StackFrame (0, true), ex.Message);
data = new LogData (LogLevel.Fatal, new StackFrame (0, true), ex.Message);
Console.WriteLine (data.ToString ());
}
}
@ -204,10 +204,10 @@ namespace WebSocketSharp
#region Public Methods
/// <summary>
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.DEBUG"/>.
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.Debug"/>.
/// </summary>
/// <remarks>
/// If the current logging level is greater than the <see cref="LogLevel.DEBUG"/>,
/// If the current logging level is greater than the <see cref="LogLevel.Debug"/>,
/// this method does not output <paramref name="message"/> as a log.
/// </remarks>
/// <param name="message">
@ -215,14 +215,14 @@ namespace WebSocketSharp
/// </param>
public void Debug (string message)
{
output (message, LogLevel.DEBUG);
output (message, LogLevel.Debug);
}
/// <summary>
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.ERROR"/>.
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.Error"/>.
/// </summary>
/// <remarks>
/// If the current logging level is greater than the <see cref="LogLevel.ERROR"/>,
/// If the current logging level is greater than the <see cref="LogLevel.Error"/>,
/// this method does not output <paramref name="message"/> as a log.
/// </remarks>
/// <param name="message">
@ -230,14 +230,14 @@ namespace WebSocketSharp
/// </param>
public void Error (string message)
{
output (message, LogLevel.ERROR);
output (message, LogLevel.Error);
}
/// <summary>
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.FATAL"/>.
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.Fatal"/>.
/// </summary>
/// <remarks>
/// If the current logging level is greater than the <see cref="LogLevel.FATAL"/>,
/// If the current logging level is greater than the <see cref="LogLevel.Fatal"/>,
/// this method does not output <paramref name="message"/> as a log.
/// </remarks>
/// <param name="message">
@ -245,14 +245,14 @@ namespace WebSocketSharp
/// </param>
public void Fatal (string message)
{
output (message, LogLevel.FATAL);
output (message, LogLevel.Fatal);
}
/// <summary>
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.INFO"/>.
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.Info"/>.
/// </summary>
/// <remarks>
/// If the current logging level is greater than the <see cref="LogLevel.INFO"/>,
/// If the current logging level is greater than the <see cref="LogLevel.Info"/>,
/// this method does not output <paramref name="message"/> as a log.
/// </remarks>
/// <param name="message">
@ -260,7 +260,7 @@ namespace WebSocketSharp
/// </param>
public void Info (string message)
{
output (message, LogLevel.INFO);
output (message, LogLevel.Info);
}
/// <summary>
@ -285,10 +285,10 @@ namespace WebSocketSharp
}
/// <summary>
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.TRACE"/>.
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.Trace"/>.
/// </summary>
/// <remarks>
/// If the current logging level is greater than the <see cref="LogLevel.TRACE"/>,
/// If the current logging level is greater than the <see cref="LogLevel.Trace"/>,
/// this method does not output <paramref name="message"/> as a log.
/// </remarks>
/// <param name="message">
@ -296,14 +296,14 @@ namespace WebSocketSharp
/// </param>
public void Trace (string message)
{
output (message, LogLevel.TRACE);
output (message, LogLevel.Trace);
}
/// <summary>
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.WARN"/>.
/// Outputs the specified <see cref="string"/> as a log with the <see cref="LogLevel.Warn"/>.
/// </summary>
/// <remarks>
/// If the current logging level is greater than the <see cref="LogLevel.WARN"/>,
/// If the current logging level is greater than the <see cref="LogLevel.Warn"/>,
/// this method does not output <paramref name="message"/> as a log.
/// </remarks>
/// <param name="message">
@ -311,7 +311,7 @@ namespace WebSocketSharp
/// </param>
public void Warn (string message)
{
output (message, LogLevel.WARN);
output (message, LogLevel.Warn);
}
#endregion

View File

@ -246,7 +246,7 @@ namespace WebSocketSharp.Server
/// Gets the logging functions.
/// </summary>
/// <remarks>
/// The default logging level is <see cref="LogLevel.ERROR"/>. If you would like to change it,
/// The default logging level is <see cref="LogLevel.Error"/>. If you would like to change it,
/// you should set the <c>Log.Level</c> property to any of the <see cref="LogLevel"/> enum
/// values.
/// </remarks>

View File

@ -372,7 +372,7 @@ namespace WebSocketSharp.Server
/// Gets the logging functions.
/// </summary>
/// <remarks>
/// The default logging level is <see cref="LogLevel.ERROR"/>. If you would like to change it,
/// The default logging level is <see cref="LogLevel.Error"/>. If you would like to change it,
/// you should set the <c>Log.Level</c> property to any of the <see cref="LogLevel"/> enum
/// values.
/// </remarks>

View File

@ -310,7 +310,7 @@ namespace WebSocketSharp
/// Gets the logging functions.
/// </summary>
/// <remarks>
/// The default logging level is <see cref="LogLevel.ERROR"/>. If you would like to change it,
/// The default logging level is <see cref="LogLevel.Error"/>. If you would like to change it,
/// you should set the <c>Log.Level</c> property to any of the <see cref="LogLevel"/> enum
/// values.
/// </remarks>