Interface IFuseLogger

interface IFuseLogger {
    debug: ((...args: TSerializable[]) => void);
    enableNativeBridge: ((flag: boolean) => void);
    error: ((...args: TSerializable[]) => void);
    getLevel: (() => FuseLoggerLevel);
    info: ((...args: TSerializable[]) => void);
    setLevel: ((level: FuseLoggerLevel) => void);
    warn: ((...args: TSerializable[]) => void);
}

Implemented by

Properties

debug: ((...args: TSerializable[]) => void)

Prints debug style logs

Type declaration

    • (...args): void
    • Parameters

      Returns void

enableNativeBridge: ((flag: boolean) => void)

If enabled, log calls will also be sent to the native environment and logged in the native syslog.

Type declaration

    • (flag): void
    • Parameters

      • flag: boolean

        Implementors shall enable bridge logging if true

      Returns void

error: ((...args: TSerializable[]) => void)

Prints error style logs

Type declaration

    • (...args): void
    • Parameters

      Returns void

getLevel: (() => FuseLoggerLevel)

Gets the current logger level mask

Type declaration

info: ((...args: TSerializable[]) => void)

Prints info style logs

Type declaration

    • (...args): void
    • Parameters

      Returns void

setLevel: ((level: FuseLoggerLevel) => void)

The log level to filter prints.

This is a bitmask, so to enable multiple options, use the bitmask OR (|) operator. e.g: setLevel(INFO | WARN | ERROR)

To remove a bit, you can use getLevel() to get the current mask and use &= operator along with the bit NOT (~) operator. e.g: mask &= INFO; // Remove INFO from log outputs

Type declaration

    • (level): void
    • Parameters

      Returns void

warn: ((...args: TSerializable[]) => void)

Prints warn style logs

Type declaration

    • (...args): void
    • Parameters

      Returns void