示例#1
0
        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);
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
 private static LogStream OpenConsoleStream(ILogStreamSettings settings)
 {
     return(new LogTextStream(Console.OpenStandardOutput(), settings.Mask, (MatchType)settings.MatchMode,
                              settings.Timestamp));
 }