Sha256: ca73de35289b3585de37dd71fb74eb86a3839293fdd0d94d061bd7bc7d0c9232

Contents?: true

Size: 405 Bytes

Versions: 3

Compression:

Stored size: 405 Bytes

Contents

module Timber
  module Contexts
    # Tracks OS level process information, such as the process ID.
    class System < Context
      @keyspace = :system

      attr_reader :pid

      def initialize(attributes)
        @pid = attributes[:pid] || raise(ArgumentError.new(":pid is required"))
        @pid = @pid.to_s
      end

      def as_json(_options = {})
        {pid: pid}
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
timber-1.1.2 lib/timber/contexts/system.rb
timber-1.1.1 lib/timber/contexts/system.rb
timber-1.1.0 lib/timber/contexts/system.rb