Module logi_context

Log Message Context.

Copyright © 2014-2016 Takeru Ohta <phjgt308@gmail.com>

Description

Log Message Context

Data Types

context()

abstract datatype: context()

A context

map_form()

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

Function Index

from_map/1Creates a new context object from Map
get_channel/1Gets the channel of Context
get_headers/1Gets the headers of Context
get_location/1Gets the location of Context
get_metadata/1Gets the metadata of Context
get_severity/1Gets the severity of Context
get_timestamp/1Gets the timestamp of Context
is_context/1Returns true if X is a context object, false otherwise.
new/2Equivalent to new(Channel, os:timestamp(), Severity, logi_location:guess_location(), #{}, #{}).
new/6Creates a new context object.
to_map/1Converts Context into a map form.
unsafe_new/6Equivalent to new/6 except omission of the arguments validation.

Function Details

from_map/1

from_map(Map::map_form()) -> context()

Creates a new context object from Map

get_channel/1

get_channel(Context::context()) -> logi_channel:id()

Gets the channel of Context

get_headers/1

get_headers(Context::context()) -> logi:headers()

Gets the headers of Context

get_location/1

get_location(Context::context()) -> logi_location:location()

Gets the location of Context

get_metadata/1

get_metadata(Context::context()) -> logi:metadata()

Gets the metadata of Context

get_severity/1

get_severity(Context::context()) -> logi:severity()

Gets the severity of Context

get_timestamp/1

get_timestamp(Context::context()) -> erlang:timestamp()

Gets the timestamp of Context

is_context/1

is_context(X::context() | term()) -> boolean()

Returns true if X is a context object, false otherwise.

new/2

new(Channel::logi_channel:id(), Severity::logi:severity()) -> context()

Equivalent to new(Channel, os:timestamp(), Severity, logi_location:guess_location(), #{}, #{}).

new/6

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/1

to_map(C::context()) -> map_form()

Converts Context into a map form

unsafe_new/6

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