Class: Wx::LogChain

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

Overview

This simple class allows you to chain log sinks, that is to install a new sink but keep passing log messages to the old one instead of replacing it completely as Wx::Log.set_active_target does.

It is especially useful when you want to divert the logs somewhere (for example to a file or a log window) but also keep showing the error messages using the standard dialogs as LogGui does by default. Example of usage:

logChain = Wx::LogChain.new(Wx::LogStderr.new)
  
  # all the log messages are sent to stderr and also processed as usually
  ...

Category: Logging

Requires:

  • USE_LOG

Direct Known Subclasses

LogInterposer

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

#initialize(logger) ⇒ Wx::LogChain

Sets the specified logger (which may be NULL) as the default log target but the log messages are also passed to the previous log target if any.

Parameters:



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

def initialize(logger) end

Instance Method Details

#get_old_logWx::Log Also known as: old_log

Returns the pointer to the previously active log target (which may be NULL).

Returns:



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

def get_old_log; end

#is_passing_messagesBoolean Also known as: passing_messages?

Returns true if the messages are passed to the previously active log target (default) or false if #pass_messages had been called.

Returns:

  • (Boolean)


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

def is_passing_messages; end

#pass_messages(passMessages) ⇒ void

This method returns an undefined value.

By default, the log messages are passed to the previously active log target.

Calling this function with false parameter disables this behaviour (presumably temporarily, as you shouldn’t use Wx::LogChain at all otherwise) and it can be re-enabled by calling it again with passMessages set to true.

Parameters:

  • passMessages (Boolean)


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

def pass_messages(passMessages) end

#releasevoid

This method returns an undefined value.

Releases the redirection chain and restores the previous log instance as the active log target. Traditionally in C++ applications would rely on the destructor to do this but that is not a really predictable option in wxRuby since destruction only takes place after GC collection (which is not exactly predictable) so wxRuby adds this method to better control restoration time if needed.



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

def release; end

#set_log(logger) ⇒ void Also known as: log=

This method returns an undefined value.

Sets another log target to use (may be NULL).

The log target specified in the log_chain(wxLog) constructor or in a previous call to this function is deleted. This doesn’t change the old log target value (the one the messages are forwarded to) which still remains the same as was active when Wx::LogChain object was created.

Parameters:



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

def set_log(logger) end