private static LogStream OpenNetworkStream(ILogStreamSettings settings) { NetLogStream nls = NetUtils.CreateNetworkStream(settings.NetworkAppID, settings.NetworkAuthVersion, settings.Destination, settings.NetworkPort, settings.Mask, (MatchType)settings.MatchMode, settings.Timestamp); return(nls); }
private static LogStream OpenFileStream(ILogStreamSettings settings) { if (File.Exists(settings.Destination)) { File.Delete(settings.Destination); } return(new LogTextStream(File.OpenWrite(settings.Destination), settings.Mask, (MatchType)settings.MatchMode, settings.Timestamp)); }
private static LogStream OpenStream(ILogStreamSettings settings) { if (settings.StreamType == 2) //Network { return(OpenNetworkStream(settings)); } if (settings.StreamType == 1) //File { return(OpenFileStream(settings)); } return(OpenConsoleStream(settings)); }
private static LogStream OpenConsoleStream(ILogStreamSettings settings) { return(new LogTextStream(Console.OpenStandardOutput(), settings.Mask, (MatchType)settings.MatchMode, settings.Timestamp)); }