Copyright © 2014-2016 Takeru Ohta <phjgt308@gmail.com>
This module defines the logi_sink_writer behaviour.
Required callback functions: write/4, get_writee/1.
Sink Writer Behaviour
A sink writer will write log messages to a destination sink process.
The main purpose of writers is to write messages to some output devices (e.g., tty, file, socket).callback_module() = module()
A module that implements the logi_sink_writer
behaviour.
state() = term()
The value of the fourth arguemnt of the write/4
callback function.
abstract datatype: writer()
A writer instance.
written_data() = logi_layout:formatted_data()
The data written to a sink
get_module/1 | Gets the module of Writer |
get_state/1 | Gets the state of Writer |
get_writee/1 | Gets the writee process of log messages. |
is_callback_module/1 | Returns true if X is a module which implements the writer behaviour, otherwise false |
is_writer/1 | Returns true if X is a writer instance, otherwise false |
new/2 | Creates a new writer instance. |
write/4 | Writes a log message. |
get_module(Writer::writer()) -> callback_module()
Gets the module of Writer
Gets the state of Writer
get_writee(Writer::writer()) -> pid() | undefined
Gets the writee process of log messages
"writee" is the destination process of written_data()
of write/4
.
If such process is dead or unknown, the function returns undefined
.
is_callback_module(X::callback_module() | term()) -> boolean()
Returns true
if X
is a module which implements the writer
behaviour, otherwise false
is_writer(X::writer() | term()) -> boolean()
Returns true
if X
is a writer instance, otherwise false
new(Module::callback_module(), State::state()) -> writer()
Creates a new writer instance
write(Context::logi_context:context(), Format::io:format(), Data::logi_layout:data(), Writer::writer()) -> written_data()
Writes a log message
If it fails to write, an exception will be raised.Generated by EDoc