예제 #1
0
        static internal log_parser_base create_parser(text_reader reader) {
            reader.set_setting("type", text_reader.type(reader));
            if ( reader.settings.get("guid") == "")
                reader.set_setting("guid", Guid.NewGuid().ToString());

            if (reader is file_text_reader) 
                return create_file_parser(reader as file_text_reader);
            
            if (reader is inmem_text_reader) 
                // for testing syntax
                return new text_file_line_by_line(reader as inmem_text_reader);

            if (reader is event_log_reader) {
                if ( reader.settings.get("event.log_type") == "")
                    reader.set_setting("event.log_type", "Application|System");
                return new event_viewer(reader as event_log_reader);
            }

            if (reader is debug_text_reader) 
                return new debug_print(reader as debug_text_reader);
            

            Debug.Assert(false);
            return null;
        }
예제 #2
0
        // these are the settings that are to be saved in the context
        static public settings_as_string get_context_dependent_settings(text_reader reader, settings_as_string_readonly settings) {
            if (reader is file_text_reader) {
                return settings.sub(new []{ "syntax", "syntax_type", "aliases" });
            }

            return new settings_as_string( settings.ToString());
        }
예제 #3
0
파일: factory.cs 프로젝트: jtorjo/logwizard
        static internal log_parser_base create_parser(text_reader reader) {
            var reader_sett = reader.write_settings;
            reader_sett.type.set( text_reader.type(reader));

            if ( reader_sett.guid == "")
                reader_sett.guid.set( Guid.NewGuid().ToString());

            if (reader is file_text_reader) 
                return create_file_parser(reader as file_text_reader);
            
            if (reader is inmem_text_reader) 
                // for testing syntax
                return new text_file_line_by_line(reader as inmem_text_reader);

            if (reader is event_log_reader) 
                return new event_viewer(reader as event_log_reader);

            if (reader is debug_text_reader) 
                return new debug_print(reader as debug_text_reader);

            if (reader is database_table_reader)
                return new database_log_parser(reader as database_table_reader);

            Debug.Assert(false);
            return null;
        }
예제 #4
0
        // these are the settings that are to be saved in the context
        static public settings_as_string get_context_dependent_settings(text_reader reader, settings_as_string_readonly settings)
        {
            if (reader is file_text_reader)
            {
                return(settings.sub(new [] { "syntax", "aliases", "description_template" }));
            }

            return(new settings_as_string(settings.ToString()));
        }
예제 #5
0
파일: factory.cs 프로젝트: jtorjo/logwizard
        // these are the settings that are to be saved in the context
        static public log_settings_string get_context_dependent_settings(text_reader reader, log_settings_string_readonly settings) {
            log_settings_string result;
            if (reader is file_text_reader) 
                result = settings.sub(new []{ settings.syntax.get(), settings.aliases, settings.description_template });
            else
                result = new log_settings_string( settings.ToString());

            result.is_open_first_time.reset();
            result.apply_column_positions_to_me.reset();
            result.column_positions.reset();
            result.available_columns.reset();

            return result;
        }
예제 #6
0
        // these are the settings that are to be saved in the context
        static public log_settings_string get_context_dependent_settings(text_reader reader, log_settings_string_readonly settings)
        {
            log_settings_string result;

            if (reader is file_text_reader)
            {
                result = settings.sub(new [] { settings.syntax.get(), settings.aliases, settings.description_template });
            }
            else
            {
                result = new log_settings_string(settings.ToString());
            }

            result.is_open_first_time.reset();
            result.apply_column_positions_to_me.reset();
            result.column_positions.reset();
            result.available_columns.reset();

            return(result);
        }
예제 #7
0
        static internal log_parser_base create_parser(text_reader reader)
        {
            var reader_sett = reader.write_settings;

            reader_sett.type.set(text_reader.type(reader));

            if (reader_sett.guid == "")
            {
                reader_sett.guid.set(Guid.NewGuid().ToString());
            }

            if (reader is file_text_reader)
            {
                return(create_file_parser(reader as file_text_reader));
            }

            if (reader is inmem_text_reader)
            {
                // for testing syntax
                return(new text_file_line_by_line(reader as inmem_text_reader));
            }

            if (reader is event_log_reader)
            {
                return(new event_viewer(reader as event_log_reader));
            }

            if (reader is debug_text_reader)
            {
                return(new debug_print(reader as debug_text_reader));
            }

            if (reader is database_table_reader)
            {
                return(new database_log_parser(reader as database_table_reader));
            }

            Debug.Assert(false);
            return(null);
        }
예제 #8
0
        static internal log_parser_base create_parser(text_reader reader)
        {
            reader.set_setting("type", text_reader.type(reader));
            if (reader.settings.get("guid") == "")
            {
                reader.set_setting("guid", Guid.NewGuid().ToString());
            }

            if (reader is file_text_reader)
            {
                return(create_file_parser(reader as file_text_reader));
            }

            if (reader is inmem_text_reader)
            {
                // for testing syntax
                return(new text_file_line_by_line(reader as inmem_text_reader));
            }

            if (reader is event_log_reader)
            {
                if (reader.settings.get("event.log_type") == "")
                {
                    reader.set_setting("event.log_type", "Application|System");
                }
                return(new event_viewer(reader as event_log_reader));
            }

            if (reader is debug_text_reader)
            {
                return(new debug_print(reader as debug_text_reader));
            }


            Debug.Assert(false);
            return(null);
        }
예제 #9
0
 // these are the settings that are to be saved per-log
 static public log_settings_string get_log_dependent_settings(text_reader reader, log_settings_string_readonly settings)
 {
     return(new log_settings_string(settings.ToString()));
 }
예제 #10
0
        private void on_new_shared_log(string name)
        {
            if ( text_ != null)
                text_.Dispose();

            if ( text_ != null && !(text_ is shared_memory_text_reader))
                text_ = new shared_memory_text_reader();
            ((shared_memory_text_reader)text_).set_memory_name( name);
            on_new_log();
        }
예제 #11
0
        private void on_new_file_log(string name)
        {
            if (text_ != null && text_.name == name)
                return;

            if ( text_ != null)
                text_.Dispose();

            text_ = new file_text_reader(name);
            on_new_log();

            ui_context file_ctx = file_to_context(name);
            if (file_ctx != cur_context())
                // update context based on file name
                curContextCtrl.SelectedIndex = contexts_.IndexOf(file_ctx);

            force_initial_refresh_of_all_views();
        }
예제 #12
0
        private void on_new_debug_log()
        {
            if ( text_ != null)
                text_.Dispose();

            text_ = new debug_text_reader();
            on_new_log();
        }
예제 #13
0
 // these are the settings that are to be saved per-log
 static public settings_as_string get_log_dependent_settings(text_reader reader, settings_as_string_readonly settings) {
     return new settings_as_string( settings.ToString());
 }
예제 #14
0
 // these are the settings that are to be saved in the context
 static public log_settings_string get_context_dependent_settings(text_reader reader, log_settings_string_readonly settings) {
     if (reader is file_text_reader) 
         return settings.sub(new []{ settings.syntax.get(), settings.aliases, settings.description_template });
     
     return new log_settings_string( settings.ToString());
 }
예제 #15
0
 public log_line_parser(text_reader reader, string syntax)
 {
     Debug.Assert(reader != null);
     line_contains_msg_only_[(int) info_type.msg] = new Tuple<int, int>(0, -1);
     parse_syntax(syntax);
     text_reader_ = reader;
     force_reload();
     new Thread(refresh_thread) {IsBackground = true}.Start();
 }
예제 #16
0
파일: factory.cs 프로젝트: noelhx/logwizard
 // these are the settings that are to be saved in the context
 static public settings_as_string get_context_dependent_settings(text_reader reader, settings_as_string_readonly settings) {
     if (reader is file_text_reader) 
         return settings.sub(new []{ "syntax", "aliases", "description_template" });
     
     return new settings_as_string( settings.ToString());
 }