@kkdev92/vscode-ext-kit - v7.1.0
    Preparing search index...

    Function filterLogger

    • A logger that passes on to logger only the entries at threshold or above, and none at all when it is silent.

      This is for an extension's own log-level setting. VS Code filters a log channel by the level the user picks, with Developer: Set Log Level or in the Output panel, and the API gives an extension no way to change that level. A setting of the extension's own can therefore only make the log quieter than the channel already is, and this is how it does.

      threshold may be a function, read on every entry, so that a logger made once — by a service when it is constructed, say — follows the setting as it changes. A threshold that throws, or that is not one of the six, lets every entry through: a broken filter must not hide the log, and logging must not fail the work that logged. Children from withFields keep the threshold.

      Parameters

      Returns Logger

      module.services.singleton(Renderer, {
      inject: { log: Log, settings: Settings.token },
      create: ({ log, settings }) =>
      new Renderer(filterLogger(log, () => settings.read().values.logLevel)),
      });