Class: Wx::LogGui

Inherits:
Log
  • Object
show all
Defined in:
lib/wx/doc/gen/log.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

This is the default log target for the GUI wxWidgets applications.

Please see Logging Customization for explanation of how to change the default log target. An object of this class is used by default to show the log messages created by using log_message, log_error and other logging functions. It doesn’t display the messages logged by them immediately however but accumulates all messages logged during an event handler execution and then shows them all at once when its Wx::Log#flush method is called during the idle time processing. This has the important advantage of showing only a single dialog to the user even if several messages were logged because of a single error as it often happens (e.g. a low level function could log a message because it failed to open a file resulting in its caller logging another message due to the failure of higher level operation requiring the use of this file). If you need to force the display of all previously logged messages immediately you can use Wx::Log.flush_active to force the dialog display. Also notice that if an error message is logged when several informative messages had been already logged before, the informative messages are discarded on the assumption that they are not useful and may be confusing and hence harmful any more after the error. The warning and error messages are never discarded however and any informational messages logged after the first error one are also kept (as they may contain information about the error recovery). You may override DoLog() method to change this behaviour. At any rate, it is possible that that several messages were accumulated before this class Wx::Log#flush method is called. If this is the case, Wx::Log#flush uses a custom dialog which shows the last message directly and allows the user to view the previously logged ones by expanding the “Details” CollapsiblePane inside it. This custom dialog also provides the buttons for copying the log messages to the clipboard and saving them to a file. However if only a single message is present when Wx::Log#flush is called, just a message_box is used to show it. This has the advantage of being closer to the native behaviour but it doesn’t give the user any possibility to copy or save the message (except for the recent Windows versions where Ctrl-C may be pressed in the message box to copy its contents to the clipboard) so you may want to override do_show_single_log_message to customize LogGui the dialogs sample shows how to do this.

Category: Logging

Requires:

  • USE_LOG

Instance Method Summary collapse

Methods inherited from Log

add_trace_mask, clear_trace_masks, disable_timestamp, #do_log_record, #do_log_text, #do_log_text_at_level, dont_create_on_demand, enable_logging, #flush, flush_active, for_component, get_active_target, get_log_level, get_repetition_counting, get_timestamp, get_trace_masks, get_verbose, is_allowed_trace_mask, is_enabled, is_level_enabled, #log_record, remove_trace_mask, resume, set_active_target, set_component_level, set_log_level, set_repetition_counting, set_timestamp, set_verbose, suspend

Constructor Details

#initializeWx::LogGui

Default constructor.



420
# File 'lib/wx/doc/gen/log.rb', line 420

def initialize; end