Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion websocket-sharp/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@

namespace WebSocketSharp
{
public interface IWebSocketLogger
{
void Debug (string message);
void Error (string message);
void Fatal (string message);
void Info (string message);
void Trace (string message);
void Warn (string message);
}

/// <summary>
/// Provides a set of methods and properties for logging.
/// </summary>
Expand All @@ -49,7 +59,7 @@ namespace WebSocketSharp
/// <see cref="Logger.Output"/> to any <c>Action&lt;LogData, string&gt;</c> delegate.
/// </para>
/// </remarks>
public class Logger
public class Logger : IWebSocketLogger
{
#region Private Fields

Expand Down
2 changes: 1 addition & 1 deletion websocket-sharp/Server/WebSocketBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected WebSocketBehavior ()
/// A <see cref="Logger"/> that provides the logging functions,
/// or <see langword="null"/> if the WebSocket connection isn't established.
/// </value>
protected Logger Log {
protected IWebSocketLogger Log {
get {
return _websocket != null ? _websocket.Log : null;
}
Expand Down
6 changes: 3 additions & 3 deletions websocket-sharp/WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private Func<WebSocketContext, string>
_handshakeRequestChecker;
private bool _ignoreExtensions;
private bool _inContinuation;
private volatile Logger _logger;
private volatile IWebSocketLogger _logger;
private Queue<MessageEventArgs> _messageEventQueue;
private uint _nonceCount;
private string _origin;
Expand Down Expand Up @@ -435,12 +435,12 @@ public bool IsSecure {
/// <value>
/// A <see cref="Logger"/> that provides the logging functions.
/// </value>
public Logger Log {
public IWebSocketLogger Log {
get {
return _logger;
}

internal set {
set {
_logger = value;
}
}
Expand Down