vapor-chamber API reference - v1.16.0
    Preparing search index...

    Function logger

    • Logger plugin - logs all commands and results

      Successful dispatches log at 'info', failed dispatches at 'error'. The default level: 'info' shows both (unchanged output); raise it to 'warn' or 'error' to hide successful dispatches and only see failures.

      Parameters

      • options: {
            collapsed?: boolean;
            filter?: (cmd: Command) => boolean;
            level?: "error" | "warn" | "info" | "debug";
            badges?: boolean;
        } = {}
        • Optionalcollapsed?: boolean
        • Optionalfilter?: (cmd: Command) => boolean
        • Optionallevel?: "error" | "warn" | "info" | "debug"

          Minimum level to log. Ok results log at 'info', failures at 'error'. Default: 'info'.

        • Optionalbadges?: boolean

          Prefix the group label with a fixed-width [ OK ] / [ FAIL ] badge. Default: false.

      Returns Plugin

      bus.use(logger()); // ⚡ cartAdd — everything, as before
      
      // Failures only, with fixed-width [  OK  ] / [ FAIL ] badges
      // (colored via %c in browsers, plain brackets in Node)
      bus.use(logger({ level: 'error', badges: true }));