logi_ex v0.1.1 Logi.Sink

Sinks.

A sink has the specification of a sink process (see Logi.SinkProc). A sink process manages a sink writer (See Logi.SinkWriter).

See the documentations of Logi.BuiltIn.Sink.* modules for usage examples.

Summary

Types

The identifier of a sink

A sink

The specification of a sink process

The supervise flags of a sink process

Functions

Creates a sink from standalone a writer instance

Equivalent to Logi.Sink.get_spec(sink)[:id]

Gets the process specification of sink

Gets the supervise flags of sink

Creates a new sink

Returns true if x is a sink/0 value, false otherwise

Types

id()
id() :: any

The identifier of a sink.

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

sink()

A sink

spec()
spec() :: :supervisor.child_spec

The specification of a sink process.

See Erlang 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 Erlang official documents of :supervisor for more information.

NOTE: :strategy field is ignored.

Functions

from_writer(sink_id, writer)

Creates a sink from standalone a writer instance.

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

get_id(sink)
get_id(sink) :: id

Equivalent to Logi.Sink.get_spec(sink)[:id].

get_spec(sink)
get_spec(sink) :: spec

Gets the process specification of sink.

The type of the return value is always map.

get_sup_flags(sink)
get_sup_flags(sink) :: sup_flags

Gets the supervise flags of sink.

The type of the return value is always map.

new(spec, flags \\ %{})
new(spec, sup_flags) :: sink

Creates a new sink.

sink?(x)
sink?(any) :: boolean

Returns true if x is a sink/0 value, false otherwise.