Class: Logging::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/unibanner/logger.rb

Instance Method Summary collapse

Instance Method Details

#incoming(data = nil) ⇒ Object

log an incoming line

Parameters:

  • data (String) (defaults to: nil)

    line to log



11
12
13
14
15
# File 'lib/unibanner/logger.rb', line 11

def incoming( data = nil )
  data = yield if block_given?
  log_event(::Logging::LogEvent.new(@name, 1, " #{Paint['->', 'green']} #{data}", @caller_tracing))
  true
end

#incoming?Boolean

Returns:

  • (Boolean)


7
# File 'lib/unibanner/logger.rb', line 7

def incoming?( ); true; end

#outgoing(data = nil) ⇒ Object

log an outgoing line

Parameters:

  • data (String) (defaults to: nil)

    line to log



19
20
21
22
23
# File 'lib/unibanner/logger.rb', line 19

def outgoing( data = nil )
  data = yield if block_given?
  log_event(::Logging::LogEvent.new(@name, 1, " #{Paint['<-', 'red']} #{data}", @caller_tracing))
  true
end

#outgoing?Boolean

Returns:

  • (Boolean)


16
# File 'lib/unibanner/logger.rb', line 16

def outgoing?( ); true; end