Module logi_sink_console

A sink which prints log messages to the console.

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

Behaviours: logi_sink_writer.

Description

A sink which prints log messages to the console

NOTE

The sink has no overload protections, so it is recommended to use it together with (for example) logi_slink_flow_limiter in a production environment.

EXAMPLE

  > error_logger:tty(false). % Suppresses annoying warnings for the sake of brevity
  >
  > logi_channel:install_sink(logi_sink_console:new(foo), info).
  > logi:info("hello world").
  2015-11-03 10:58:59.920 [info] nonode@nohost <0.113.0> erl_eval:do_apply:673 [] hello world
  
Uses other layout:
  > logi_channel:install_sink(logi_sink_console:new(foo, logi_layout_io_lib_format:new()), info).
  > logi:info("hello world").
  hello world
  

Function Index

default_layout/0Default layout.
new/1Equivalent to new(SinkId, default_layout()).
new/2Creates a new sink.

Function Details

default_layout/0

default_layout() -> Layout::logi_layout:layout(unicode:chardata())

Default layout

Layout is logi_layout_newline:new(logi_layout_color:new(logi_layout_limit:new(logi_layout_default:new())))

new/1

new(SinkId::logi_sink:id()) -> logi_sink:sink()

Equivalent to new(SinkId, default_layout()).

new/2

new(SinkId::logi_sink:id(), Layout::logi_layout:layout(unicode:chardata())) -> logi_sink:sink()

Creates a new sink


Generated by EDoc, Sep 27 2018, 23:13:24.