Class FuseLogger

A base logger implementation which includes a serializer for common types. It will serialize/accept all values that TSerializable accepts, however Blob/ArrayBuffer or other binary data types will not be serialized. Instead it will print an object identifier, with mime type if present, along with the size of the buffer.

The base logger does not provide any native bridging. While usable for purely webview side, use the FuseLoggerFactory to get a logger specific for your runtime environment.

Hierarchy (view full)

Implements

Constructors

Methods

    • Implementators use this method to call on the native logging API.

    Parameters

    • level: FuseLoggerLevel

      The log level for this log print

    • message: string

      Overridable hook to send logs to the native environment

    Returns void

  • Parameters

    • flag: boolean

      enables the native bridge logging if enabled.

    Returns void

    If enabled, The native FuseLogger will pass native log messages to the webview and will be logged into the JS console. Logs passed through this logger will also be passed to the native environment and will be logged in the native's logging console.

    This can be helpful in debugging where all logs will be in the same place, however, logging can be verbose and can cause a degration of performance, therefore it may not be desirable to have enabled for production builds.

    This feature is currently enabled by default, however this is subject to change.

  • Parameters

    • level: number

      A bitmask option to indicate which levels to log.

    Returns void

    To report on WARN and ERROR only, you would set:

    logger.setLevel(FuseLoggerLevel.WARN | FuseLoggerLevel.ERROR);