Copyright © 2014-2016 Takeru Ohta <phjgt308@gmail.com>
abstract datatype: context()
A context
map_form() = #{channel => logi_channel:id(), timestamp => erlang:timestamp(), severity => logi:severity(), location => logi_location:location(), headers => logi:headers(), metadata => logi:metadata()}
The map representation of a context
from_map/1 | Creates a new context object from Map |
get_channel/1 | Gets the channel of Context |
get_headers/1 | Gets the headers of Context |
get_location/1 | Gets the location of Context |
get_metadata/1 | Gets the metadata of Context |
get_severity/1 | Gets the severity of Context |
get_timestamp/1 | Gets the timestamp of Context |
is_context/1 | Returns true if X is a context object, false otherwise. |
new/2 | Equivalent to new(Channel, os:timestamp(), Severity, logi_location:guess_location(), #{}, #{}). |
new/6 | Creates a new context object. |
to_map/1 | Converts Context into a map form. |
unsafe_new/6 | Equivalent to new/6 except omission of the arguments validation. |
from_map(Map::map_form()) -> context()
Creates a new context object from Map
get_channel(Context::context()) -> logi_channel:id()
Gets the channel of Context
get_headers(Context::context()) -> logi:headers()
Gets the headers of Context
get_location(Context::context()) -> logi_location:location()
Gets the location of Context
get_metadata(Context::context()) -> logi:metadata()
Gets the metadata of Context
get_severity(Context::context()) -> logi:severity()
Gets the severity of Context
get_timestamp(Context::context()) -> erlang:timestamp()
Gets the timestamp of Context
is_context(X::context() | term()) -> boolean()
Returns true
if X
is a context object, false
otherwise.
new(Channel::logi_channel:id(), Severity::logi:severity()) -> context()
Equivalent to new(Channel, os:timestamp(), Severity, logi_location:guess_location(), #{}, #{}).
new(Channel::logi_channel:id(), Timestamp::erlang:timestamp(), Severity::logi:severity(), Location::logi_location:location(), Headers::logi:headers(), Metadata::logi:metadata()) -> context()
Creates a new context object
to_map(C::context()) -> map_form()
Converts Context
into a map form
unsafe_new(Channel::logi_channel:id(), Timestamp::erlang:timestamp(), Severity::logi:severity(), Location::logi_location:location(), Headers::logi:headers(), Metadata::logi:metadata()) -> context()
Equivalent to new/6
except omission of the arguments validation
Generated by EDoc