Class: GrpcAccessLoggingInterceptor::DefaultLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/grpc_access_logging_interceptor/default_logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger: Logger.new($stdout)) ⇒ DefaultLogger

Returns a new instance of DefaultLogger.

Parameters:

  • logger (#info) (defaults to: Logger.new($stdout))


7
8
9
# File 'lib/grpc_access_logging_interceptor/default_logger.rb', line 7

def initialize(logger: Logger.new($stdout))
  @logger = logger
end

Instance Method Details

#log(data) ⇒ Object

Parameters:

  • hash (Hash)


12
13
14
# File 'lib/grpc_access_logging_interceptor/default_logger.rb', line 12

def log(data)
  @logger.info(data.to_json)
end