public static void LogError(this ILogTag obj, string format, params object[] args) { string message = GetLogText(GetLogTag(obj), GetLogCaller(), string.Format(format, args)); Internal_LogError(Prefix + message); LogToFile("[E]" + message, EnableErrorStack); }
public static void LogWarning(this ILogTag obj, string format, params object[] args) { string message = GetLogText(GetLogTag(obj), GetLogCaller(), string.Format(format, args)); Internal_LogWarning(Prefix + message); LogToFile("[W]" + message); }
public static void Log(this ILogTag obj, string message = "") { if (!Debuger.EnableLog) { return; } message = GetLogText(GetLogTag(obj), GetLogCaller(), message); Internal_Log(Prefix + message); }
public static void Log(this ILogTag obj, string format, params object[] args) { if (!Debuger.EnableLog) { return; } string message = GetLogText(GetLogTag(obj), GetLogCaller(), string.Format(format, args)); Internal_Log(Prefix + message); }
public static void SetTag(ILogTag tag) { if (tag == null) { return; } lock (threadTags) { threadTags[Thread.CurrentThread.ManagedThreadId] = tag; } }
public static void LogVerbose(this ILogTag obj, string message = "") { if (!EnableLog || !EnableLogVerbose) { return; } message = GetLogText(GetLogTag(obj), GetLogCaller(), message); Internal_Log(Prefix + message); LogToFile("[I]" + message); }
/// <summary> /// Initializes a new instance of the StandardSocket class /// </summary> public BaseSocket( AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, ILogTag logTag ) { this.addressFamily = addressFamily; this.socketType = socketType; this.protocolType = protocolType; this.logTag = logTag; }
public static void LogVerbose(this ILogTag obj, string format, params object[] args) { if (!EnableLog || !EnableLogVerbose) { return; } string message = GetLogText(GetLogTag(obj), GetLogCaller(), string.Format(format, args)); Internal_Log(Prefix + message); LogToFile("[I]" + message); }
private static string GetLogTag(ILogTag obj) { return(obj.LOG_TAG); /* * ILogTag tag = obj as ILogTag; * if (tag != null) * { * return tag.LOG_TAG; * } * return obj.GetType().Name; */ }
/// <summary> /// Initializes a new instance of the StandardSocket class /// </summary> public StandardSocket( AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, ILogTag logTag ) : base(addressFamily, socketType, protocolType, logTag) { socket = new Socket(addressFamily, socketType, protocolType); socket.NoDelay = true; try { socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, SOCKET_BUFFER_SIZE); socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, SOCKET_BUFFER_SIZE); } catch (Exception ex) { log.Warn("Failed to set socket buffers: " + ex.Message); } }
public static void LogError(this ILogTag obj, string message) { message = GetLogText(GetLogTag(obj), GetLogCaller(), message); Internal_LogError(Prefix + message); LogToFile("[E]" + message, EnableErrorStack); }
/// <summary> /// Default constructor /// </summary> internal FTPControlSocket(ILogTag logTag) { this.logTag = logTag; }
/// <summary> /// Constructor. Performs TCP connection and /// sets up reader/writer. Allows different control /// port to be used /// </summary> /// <param name="remoteHost"> /// Remote inet address /// </param> /// <param name="controlPort"> /// port for control stream /// </param> /// <param name="timeout"> /// the length of the timeout, in milliseconds /// </param> /// <param name="encoding"> /// encoding to use for control channel /// </param> internal FTPControlSocket(string remoteHost, int controlPort, int timeout, Encoding encoding, ILogTag logTag) : this(logTag) { if (activePortRange != null) { activePortRange.ValidateRange(); } Initialize( new StandardSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp, logTag), remoteHost, controlPort, timeout, encoding); }
public static void SetTag(ILogTag tag) { if (tag == null) { return; } lock (Logger.threadTags) { Logger.threadTags[Thread.CurrentThread.ManagedThreadId] = tag; } }
/// <summary> /// Default constructor /// </summary> internal FTPControlSocket(ILogTag logTag) { this.logTag = logTag; }
/// <summary> /// Initializes a new instance of the StandardSocket class /// </summary> public BaseSocket( AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, ILogTag logTag ) { this.addressFamily = addressFamily; this.socketType = socketType; this.protocolType = protocolType; this.logTag = logTag; }
public static void LogWarning(this ILogTag obj, string message) { message = GetLogText(GetLogTag(obj), GetLogCaller(), message); Internal_LogWarning(Prefix + message); LogToFile("[W]" + message); }
public static void LogError(this ILogTag obj, string message) { message = GetLogText(GetLogTag(obj), GetLogCaller(), message); Internal_LogError(Prefix + message); }
/// <summary> /// Initializes a new instance of the StandardSocket class /// </summary> public StandardSocket( AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, ILogTag logTag ) : base(addressFamily, socketType, protocolType, logTag) { socket = new Socket(addressFamily, socketType, protocolType); socket.NoDelay = true; try { socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, SOCKET_BUFFER_SIZE); socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, SOCKET_BUFFER_SIZE); } catch (Exception ex) { log.Warn("Failed to set socket buffers: " + ex.Message); } }
/// <summary> /// Constructor. Performs TCP connection and /// sets up reader/writer. Allows different control /// port to be used /// </summary> /// <param name="remoteHost"> /// Remote inet address /// </param> /// <param name="controlPort"> /// port for control stream /// </param> /// <param name="timeout"> /// the length of the timeout, in milliseconds /// </param> /// <param name="encoding"> /// encoding to use for control channel /// </param> internal FTPControlSocket(string remoteHost, int controlPort, int timeout, Encoding encoding, ILogTag logTag) : this(logTag) { if (activePortRange != null) activePortRange.ValidateRange(); Initialize( new StandardSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp, logTag), remoteHost, controlPort, timeout, encoding); }