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 #if DEBUG
ws.Log.Level = LogLevel.TRACE; ws.Log.Level = LogLevel.Trace;
#endif #endif
//ws.Compression = CompressionMethod.DEFLATE; //ws.Compression = CompressionMethod.DEFLATE;
//ws.Origin = "http://echo.websocket.org"; //ws.Origin = "http://echo.websocket.org";

View File

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

View File

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

View File

@ -17,7 +17,7 @@ namespace Example3
//_httpsv = new HttpServer (4649, true) // Secure; //_httpsv = new HttpServer (4649, true) // Secure;
#if DEBUG #if DEBUG
_httpsv.Log.Level = LogLevel.TRACE; _httpsv.Log.Level = LogLevel.Trace;
#endif #endif
/* Secure Connection /* 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`). 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 ```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 ```cs
ws.Log.Debug ("This is a debug message."); ws.Log.Debug ("This is a debug message.");

View File

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

View File

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

View File

@ -246,7 +246,7 @@ namespace WebSocketSharp.Server
/// Gets the logging functions. /// Gets the logging functions.
/// </summary> /// </summary>
/// <remarks> /// <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 /// you should set the <c>Log.Level</c> property to any of the <see cref="LogLevel"/> enum
/// values. /// values.
/// </remarks> /// </remarks>

View File

@ -372,7 +372,7 @@ namespace WebSocketSharp.Server
/// Gets the logging functions. /// Gets the logging functions.
/// </summary> /// </summary>
/// <remarks> /// <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 /// you should set the <c>Log.Level</c> property to any of the <see cref="LogLevel"/> enum
/// values. /// values.
/// </remarks> /// </remarks>

View File

@ -310,7 +310,7 @@ namespace WebSocketSharp
/// Gets the logging functions. /// Gets the logging functions.
/// </summary> /// </summary>
/// <remarks> /// <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 /// you should set the <c>Log.Level</c> property to any of the <see cref="LogLevel"/> enum
/// values. /// values.
/// </remarks> /// </remarks>