コード例 #1
0
        private void LoadConfiguration()
        {
            DataTrackConfigReader reader = new DataTrackConfigReader();

            databaseConfig = new DatabaseConfiguration(reader.GetDatabaseConfigNode());
            loggingConfig  = new LogConfiguration(reader.GetLoggingConfigNode());
            cacheConfig    = new CacheConfiguration(reader.GetCacheConfigNode());
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: callumg2895/DataTrack
        static void Main(string[] args)
        {
            DataTrackConfigReader configReader = new DataTrackConfigReader();
            LogConfiguration      logConfig    = new LogConfiguration(configReader.GetLoggingConfigNode());

            LogReader reader = new LogReader(logConfig);

            List <LogStatement> logBuffer = reader.Read();

            foreach (LogStatement statement in logBuffer)
            {
                statement.Write();
            }

            LogStats stats = reader.ReadStats();

            Console.WriteLine();
            Console.WriteLine($"Total TRACE: {stats.totalTRC}");
            Console.WriteLine($"Total DEBUG: {stats.totalDBG}");
            Console.WriteLine($"Total INFO: {stats.totalINF}");
            Console.WriteLine($"Total WARN: {stats.totalWRN}");
            Console.WriteLine($"Total ERROR: {stats.totalERR}");
            Console.WriteLine($"Total CRITICAL: {stats.totalERF}");
        }