firewatch-js
    Preparing search index...

    Interface InitOptions

    interface InitOptions {
        interceptors?: {
            interceptConsole?:
                | boolean
                | {
                    debug?: boolean;
                    error?: boolean;
                    info?: boolean;
                    log?: boolean;
                    warn?: boolean;
                };
            interceptUncaughtExceptions?: boolean;
            interceptUnhandledRejections?: boolean;
        };
        sendLog?: (logEntry: LogEntry) => Promise<void>;
        url?: string;
    }
    Index

    Properties

    interceptors?: {
        interceptConsole?:
            | boolean
            | {
                debug?: boolean;
                error?: boolean;
                info?: boolean;
                log?: boolean;
                warn?: boolean;
            };
        interceptUncaughtExceptions?: boolean;
        interceptUnhandledRejections?: boolean;
    }

    Type Declaration

    • OptionalinterceptConsole?:
          | boolean
          | {
              debug?: boolean;
              error?: boolean;
              info?: boolean;
              log?: boolean;
              warn?: boolean;
          }

      Whether to intercept console methods. If it's in a boolean form, either intercept all console methods or none. If it's in an object form, you can specify which console methods to intercept.

      true
      
    • OptionalinterceptUncaughtExceptions?: boolean

      Add a listener for uncaught exceptions and send them to the backend.

      true
      
    • OptionalinterceptUnhandledRejections?: boolean

      Add a listener for unhandled promise rejections and send them to the backend.

      true
      
    sendLog?: (logEntry: LogEntry) => Promise<void>

    Allows you to customize log before sending it to the backend.

    Type Declaration

      • (logEntry: LogEntry): Promise<void>
      • Parameters

        • logEntry: LogEntry

          The log entry to send.

        Returns Promise<void>

        A promise resolving when the log entry has been sent.

    url?: string

    The URL of the backend to send logs to. If not provided, the sendLog function must be provided. If both 'url' and 'sendLog' are provided, 'sendLog' will take precedence.