Class

SparkLogger

SparkLogger()

This logger class provides a set of utility logging functions to SPARK developers.

The intent is to provide a single system to use for logging, which can be modified/updated to meet future logging needs without requiring developers to modify existing applications use of the service.

Currently the logger only provides some basic wrapper functions to allow developers to log messages to the console while the react build is not production (e.g. during local development).

In future, the logger should:

  • Support multiple logging destinations (including remote destinations)
  • Contain additional debugging features
  • Contain performance logging capacity

A singleton instance of the SparkLogger is exported as logger, and can be imported with import {logger} from '@jcu/spark'

Constructor

# new SparkLogger()

Constructor currently sets devMode during instantiation

View Source services/SparkLogger.ts, line 21

Classes

SparkLogger

Methods

# devError()

A wrapper function for console.error that only logs if devMode is true, i.e. not a production build.

Has the same parameters and return values as console.error

View Source services/SparkLogger.ts, line 49

# devLog()

A wrapper function for console.log that only logs if devMode is true, i.e. not a production build.

Has the same parameters and return values as console.log

View Source services/SparkLogger.ts, line 62

# devWarn()

A wrapper function for console.warn that only logs if devMode is true, i.e. not a production build.

Has the same parameters and return values as console.warn

View Source services/SparkLogger.ts, line 36