newLayout

Gets a new layout instance, based on the given name.

Parameters

layout_str cstring

name of the desired layout

Return Value

Type: Layout

an instance of a suitable layout based on the input string

Throws

if layout_str cannot be matched to any layout

Examples

// In a real app those would be full-fledged implementation
alias LayoutSimple AquaticLayout;
alias LayoutSimple SubmarineLayout;

void myConfigureLoggers (
    ConfigIterator config,
    MetaConfig m_config,
    scope Appender delegate ( istring file, Layout layout ) file_appender,
    bool use_insert_appender = false)
{
    Layout makeLayout (cstring name)
    {
        if (name == "aquatic")
            return new AquaticLayout;
        if (name == "submarine")
            return new SubmarineLayout;
        return ocean.util.log.Config.newLayout(name);
    }
    ocean.util.log.Config.configureNewLoggers(config, m_config,
        file_appender, &makeLayout, use_insert_appender);
}

Meta