package vlt
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=756a6cba94204cda45ee767ca5f7e52ec321873dd53de48025c32dba1e03de24
md5=c0f22efcafa1119a9c82ffd9d7422da2
doc/vlt/Vlt/Layout/index.html
Module Vlt.LayoutSource
This module defines the concept of layout, that is how an event is rendered into a string. It is possible to register new layouts through the register function. Initially, all the layouts defined in this file (except pattern and csv) are registered (using the function name as the registration name).
Definitions
The type of layouts, the components being:
- the header written before any event (and possibly at each rotation, if any);
- the footer written after all event (and possibly at each rotation, if any);
- the function actually converting the event into a string.
However, the exact semantics of each element is highly output-dependent.
register n l registers the layout l with name n, replacing any existing layout with the same name.
Similar to register except that an unused name is generated and returned.
get n returns the layout registered with name n.
Raises Not_found if no layout exists with the passed name.
Predefined layouts
The layout initially registered with the name "default".
Format:
TIME [FILE LINE] LEVEL MESSAGE
pattern h f r constructs a layout (h, f, r') where r' is the rendering function defined by the string r. The rendering is done by substituting the substring of the form "$(key)" or "$(key:pad)" with their associated values. The key/value associations are as defined by the function Event.bindings. The absolute value of pad defines the minimum size of the value when rendered. Moreover, if pad is negative padding spaces are added on the left while they are added to the right if pad is positive.
The layout initially registered with the name "html". Renders the log events into an html table.