• Changes the log level of a logger.

    Parameters

    • name: string

      name of a logger. Empty string changes the root logger.

    • Optionallevel: LogLevel

      the new level of the logger.

    Returns void

     import {setLogLevel} from "apprt-core/Logger";
    // Changes the root level to DEBUG
    // All loggers without special configuration will now output messages.
    setLogLevel("", "DEBUG");

    // Changes the log level of the bundle 'apprt-core' to DEBUG.
    // All loggers in this bundle will now output messages.
    setLogLevel("apprt-core", "DEBUG");

    // Changes the log level of the bundles file 'apprt-core/Promise' to DEBUG.
    // Only the special logger will now output messages.
    setLogLevel("apprt-core/Promise", "DEBUG");

    // clears the config for the logger and inherits from the parent.
    // this is not allowed for the root logger
    setLogLevel("apprt-core/Promise");