Current section

Files

Jump to
logi_stdlib src logi_layout_io_lib_format.erl
Raw

src/logi_layout_io_lib_format.erl

%% @copyright 2015-2016 Takeru Ohta <phjgt308@gmail.com>
%%
%% @doc A logi_layout implementation which uses 'io_lib:format/2' function to format log messages
%% @end
-module(logi_layout_io_lib_format).
-behaviour(logi_layout).
%%----------------------------------------------------------------------------------------------------------------------
%% Exported API
%%----------------------------------------------------------------------------------------------------------------------
-export([new/0]).
%%----------------------------------------------------------------------------------------------------------------------
%% 'logi_layout' Callback API
%%----------------------------------------------------------------------------------------------------------------------
-export([format/4]).
%%----------------------------------------------------------------------------------------------------------------------
%% Exported API
%%----------------------------------------------------------------------------------------------------------------------
%% @doc Creates a new layout instance
-spec new() -> logi_layout:layout().
new() ->
logi_layout:new(?MODULE).
%%----------------------------------------------------------------------------------------------------------------------
%% 'logi_layout' Callback Functions
%%----------------------------------------------------------------------------------------------------------------------
%% @private
format(_, Format, Data, _) ->
io_lib:format(Format, Data).