Class: QB::IPC::STDIO::Server::LogService

Inherits:
Service
  • Object
show all
Defined in:
lib/qb/ipc/stdio/server/log_service.rb

Overview

QB STDIO Service to receive log lines in JSON format and forward them on to the logger.

Defined Under Namespace

Classes: Log

Instance Attribute Summary

Attributes inherited from Service

#env_var_name, #name, #path, #server, #socket, #thread

Instance Method Summary collapse

Methods inherited from Service

#close!, #open!, #to_s

Constructor Details

#initialize(name:, socket_dir:) ⇒ LogService

Returns a new instance of LogService.



91
92
93
94
# File 'lib/qb/ipc/stdio/server/log_service.rb', line 91

def initialize name:, socket_dir:
  super name: name, socket_dir: socket_dir
  @loggers = {}
end

Instance Method Details

#work_in_threadObject



96
97
98
99
100
101
102
103
# File 'lib/qb/ipc/stdio/server/log_service.rb', line 96

def work_in_thread
  while (line = @socket.gets) do
    logger.trace "received line",
      line: line
    
     line
  end
end