lib/timber/contexts/system.rb in timber-2.1.0.rc5 vs lib/timber/contexts/system.rb in timber-2.1.0.rc6
- old
+ new
@@ -2,10 +2,13 @@
require "timber/util"
module Timber
module Contexts
# The system context tracks OS level process information, such as the process ID.
+ #
+ # @note This is tracked automatically in {CurrentContext}. When the current context
+ # is initialized, the system context gets added automatically.
class System < Context
@keyspace = :system
attr_reader :hostname, :pid
@@ -13,10 +16,10 @@
@hostname = attributes[:hostname]
@pid = attributes[:pid]
@pid = @pid.to_s
end
- # Builds a hash representation of containing simply objects, suitable for serialization.
+ # Builds a hash representation containing simple objects, suitable for serialization (JSON).
def as_json(_options = {})
{hostname: hostname, pid: Timber::Util::Object.try(pid, :to_s)}
end
end
end
\ No newline at end of file