diff --git a/.gitignore b/.gitignore index 376bdfd86..60463b66e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ Backup* _UpgradeReport_Files bin obj +.vs *.mdb *.pdb diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..76efda9bf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,2 @@ +language: csharp +solution: websocket-sharp.sln \ No newline at end of file diff --git a/README.md b/README.md index e7049b224..50a503bf8 100644 --- a/README.md +++ b/README.md @@ -491,6 +491,12 @@ ws.SslConfiguration.ServerCertificateValidationCallback = The default callback always returns `true`. +If you need to specify SSL protocol, you could change the enum, for example: + +```csharp +ws.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.None +``` + As a WebSocket server, you should create a new instance of the `WebSocketServer` or `HttpServer` class with some settings for the secure connection, such as the following. ```csharp @@ -641,6 +647,12 @@ And if you would like to output a log, you should use any of the output methods. ws.Log.Debug ("This is a debug message."); ``` +If you would like to disable all log output, you can specify the `None` enum. + +```csharp +ws.Log.Level = LogLevel.None; +``` + The `WebSocketServer` and `HttpServer` classes have the same logging function. ## Examples ## diff --git a/websocket-sharp/LogLevel.cs b/websocket-sharp/LogLevel.cs index ef9967728..220082dd5 100644 --- a/websocket-sharp/LogLevel.cs +++ b/websocket-sharp/LogLevel.cs @@ -58,6 +58,11 @@ public enum LogLevel /// /// Specifies the top logging level. /// - Fatal + Fatal, + + /// + /// No log + /// + None } } diff --git a/websocket-sharp/Logger.cs b/websocket-sharp/Logger.cs index 17850e67e..67e4a6222 100644 --- a/websocket-sharp/Logger.cs +++ b/websocket-sharp/Logger.cs @@ -263,11 +263,18 @@ public void Error (string message) /// /// Outputs as a log with . /// + /// + /// If the current logging level is higher than , + /// this method doesn't output as a log. + /// /// /// A that represents the message to output as a log. /// public void Fatal (string message) { + if (_level > LogLevel.Fatal) + return; + output (message, LogLevel.Fatal); }