Sha256: 71ffb69186b75323ff203c982ffbc68eec288311ef7194a258dfc1090f193dba

Contents?: true

Size: 898 Bytes

Versions: 2

Compression:

Stored size: 898 Bytes

Contents

# frozen_string_literal: true

module Prefab
  class SseLogger < ::Logger
    def initialize()
      @path = "sse"
    end

    def debug(progname = nil, &block)
      Prefab::LoggerClient.instance.log_internal ::Logger::DEBUG, progname, @path, &block
    end

    def info(progname = nil, &block)
      Prefab::LoggerClient.instance.log_internal ::Logger::INFO, progname, @path, &block
    end

    # The SSE::Client warns on a perfectly normal stream disconnect, recast to info
    def warn(progname = nil, &block)
      Prefab::LoggerClient.instance.log_internal ::Logger::INFO, progname, @path, &block
    end

    def error(progname = nil, &block)
      Prefab::LoggerClient.instance.log_internal ::Logger::ERROR, progname, @path, &block
    end

    def fatal(progname = nil, &block)
      Prefab::LoggerClient.instance.log_internal ::Logger::FATAL, progname, @path, &block
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
prefab-cloud-ruby-1.2.1 lib/prefab/sse_logger.rb
prefab-cloud-ruby-1.2.0 lib/prefab/sse_logger.rb