lib/timber/contexts/system.rb in timber-2.0.9 vs lib/timber/contexts/system.rb in timber-2.0.10
- old
+ new
@@ -2,18 +2,19 @@
module Contexts
# Tracks OS level process information, such as the process ID.
class System < Context
@keyspace = :system
- attr_reader :pid
+ attr_reader :hostname, :pid
def initialize(attributes)
- @pid = attributes[:pid] || raise(ArgumentError.new(":pid is required"))
+ @hostname = attributes[:hostname]
+ @pid = attributes[:pid]
@pid = @pid.to_s
end
def as_json(_options = {})
- {pid: Timber::Util::Object.try(pid, :to_s)}
+ {hostname: hostname, pid: Timber::Util::Object.try(pid, :to_s)}
end
end
end
end
\ No newline at end of file