Variable logConst

log: Readonly<{
    debugF: ((flag: number | string, ...data: unknown[]) => void);
    fatal: ((...data: unknown[]) => void);
    info: ((...data: unknown[]) => void);
    severe: ((...data: unknown[]) => void);
    warning: ((...data: unknown[]) => void);
}> = ConnectionBinding.instance.log

Convenience access to logging methods when no instance of WinccoaManager is available.

This is particularly useful for log.debugF() and log.fatal(), which don't have a corresponding method on console.

Type declaration

  • debugF: ((flag: number | string, ...data: unknown[]) => void)

    Writes a log entry if debug flag is set.

    Note

    When setting a debug flag from the command line, the -dbg option must be positioned before the name of the JavaScript file (as any other WinCC OA manager option).

      • (flag, ...data): void
      • Parameters

        • flag: number | string
        • Rest...data: unknown[]

        Returns void

  • fatal: ((...data: unknown[]) => void)

    Writes a fatal error log entry. This also exits the WinCC OA manager.

      • (...data): void
      • Parameters

        • Rest...data: unknown[]

        Returns void

  • info: ((...data: unknown[]) => void)

    Writes an information log entry. console.log() and console.info() are mapped to this method.

      • (...data): void
      • Parameters

        • Rest...data: unknown[]

        Returns void

  • severe: ((...data: unknown[]) => void)

    Writes a severe error log entry. console.error() is mapped to this method.

      • (...data): void
      • Parameters

        • Rest...data: unknown[]

        Returns void

  • warning: ((...data: unknown[]) => void)

    Writes a warning log entry. console.warn() is mapped to this method.

      • (...data): void
      • Parameters

        • Rest...data: unknown[]

        Returns void

import { log } from 'winccoa-manager';
log.debugF('REDU', `This message is only logged when debug flag 'REDU' is set`);