Class: Uh::WM::XEventLogger

Inherits:
Object
  • Object
show all
Includes:
EnvLogging
Defined in:
lib/uh/wm/x_event_logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ XEventLogger

Returns a new instance of XEventLogger.



6
7
8
# File 'lib/uh/wm/x_event_logger.rb', line 6

def initialize env
  @env = env
end

Instance Method Details

#log_event(xev) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/uh/wm/x_event_logger.rb', line 10

def log_event xev
  complement = case xev.type
  when :key_press
    "window: #{xev.window} key: #{xev.key} mask: #{xev.modifier_mask}"
  when :map_request
    "window: #{xev.window}"
  end

  log_debug [
    'XEvent',
    xev.type,
    xev.send_event ? 'SENT' : nil,
    complement
  ].compact.join ' '
end

#log_xerror(req, resource_id, msg) ⇒ Object



26
27
28
# File 'lib/uh/wm/x_event_logger.rb', line 26

def log_xerror req, resource_id, msg
  log_error "XERROR: #{resource_id} #{req} #{msg}"
end