Module logi_builtin_layout_default

A default layout for built-in sinks.

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

Behaviours: logi_layout.

Description

A default layout for built-in sinks

This module layouts a log message by the following format:
  {yyyy}-{MM}-{dd} {HH}:{mm}:{ss}.{SSS} [{SEVERITY}] {NODE} {PID} {MODULE}:{FUNCTION}:{LINE} [{HEADER(KEY=VALUE)}*] {MESSAGE}\n

NOTE

This module is provided for debuging/testing purposes only. The message format is not customizable. And no overload protection exists (e.g. if log message is too large, the caller process may hang).

EXAMPLE

  > error_logger:tty(false). % Suppresses annoying warning outputs for brevity
 
  > Layout = logi_builtin_layout_default:new().
  > {ok, _} = logi_channel:install_sink(logi_builtin_sink_io_device:new(foo, [{layout, Layout}]), info).
  > logi:info("hello world").
  2015-10-21 15:06:42.842 [info] nonode@nohost <0.91.0> erl_eval:do_apply:673 [] hello world
  

Function Index

new/0Creates a layout.

Function Details

new/0

new() -> logi_layout:layout(io_lib:chars())

Creates a layout


Generated by EDoc