Module logi_sink

Sinks.

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

Description

Sinks

A sink has the specification of a sink process (logi_sink_proc). A sink process manages a sink writer (logi_sink_writer).

See logi_builtin_sink_XXX modules for usage examples.

Data Types

id()

id() = term()

The identifier of a sink

The scope of an identifier is limited in siblings with the same parent.

sink()

abstract datatype: sink()

A sink

spec()

spec() = supervisor:child_spec()

The specification of a sink process.

See official documents of supervisor for more information.

NOTE: restart field is ignored (always regarded as permanent).

sup_flags()

sup_flags() = supervisor:sup_flags()

The supervise flags of a sink process.

See official documents of supervisor for more information.

NOTE: strategy field is ignored.

Function Index

from_writer/2Creates a sink from standalone a writer instance.
get_id/1Equivalent to maps:get(id, get_spec(Sink)).
get_spec/1Gets the process specification of Sink
get_sup_flags/1Gets the supervise flags of Sink
is_sink/1Returns true if X is a sink, false otherwise.
new/1Equivalent to new(Spec, #{}).
new/2Creates a new sink.

Function Details

from_writer/2

from_writer(Id::id(), Writer::logi_sink_writer:writer()) -> sink()

Creates a sink from standalone a writer instance

No specific sink process is needed by Writer to write log messages.

get_id/1

get_id(Sink::sink()) -> id()

Equivalent to maps:get(id, get_spec(Sink)).

get_spec/1

get_spec(Sink::sink()) -> spec()

Gets the process specification of Sink

The type of the return value is always map.

get_sup_flags/1

get_sup_flags(Logi_sink::sink()) -> sup_flags()

Gets the supervise flags of Sink

The type of the return value is always map.

is_sink/1

is_sink(X::sink() | term()) -> boolean()

Returns true if X is a sink, false otherwise

new/1

new(Spec::spec()) -> sink()

Equivalent to new(Spec, #{}).

new/2

new(Spec::spec(), Flags::sup_flags()) -> sink()

Creates a new sink


Generated by EDoc