Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DaVinciLogger

Logger for AMC's DaVinci Apps. Logs are sent to cloud. Currently there is no way for 3rd party apps to make use of this.

Hierarchy

Index

Constructors

constructor

Properties

Protected _isDev

_isDev: boolean = false

Protected _logLevel

_logLevel: LOG_LEVEL = LOG_LEVEL.Information

Protected _logSource

_logSource: string

config

Private criticalBuffer

criticalBuffer: LogObj[] = []

Private debugBuffer

debugBuffer: LogObj[] = []

Private errorBuffer

errorBuffer: LogObj[] = []

Private informationBuffer

informationBuffer: LogObj[] = []

Private loopBuffer

loopBuffer: LogObj[] = []

Protected timerId

timerId: number = null

Private traceBuffer

traceBuffer: LogObj[] = []

Private warningBuffer

warningBuffer: LogObj[] = []

Static Protected ApiServiceUrl

ApiServiceUrl: string = null

Static tabId

tabId: string = "00000000-0000-0000-0000-000000000000"

Accessors

apiUrl

  • get apiUrl(): string
  • set apiUrl(apiUrl: string): void
  • Returns string

  • Parameters

    • apiUrl: string

    Returns void

isDev

  • get isDev(): boolean
  • set isDev(isDev: boolean): void
  • Returns boolean

  • Parameters

    • isDev: boolean

    Returns void

logLevel

logSource

  • get logSource(): string
  • set logSource(logSourceIn: LOG_SOURCE | string): void

Methods

clearTimeOutForLogger

  • clearTimeOutForLogger(): void

Protected generateLogObj

  • generateLogObj(logLevel: LOG_LEVEL, errorCode: ERROR_CODE, message: string, localTime?: Date): LogObj
  • Captures all log record information as a LogObj object

    memberof

    AbstractLogger

    Parameters

    • logLevel: LOG_LEVEL

      Log Level of log record

    • errorCode: ERROR_CODE

      Classification of error

    • message: string

      Content of log record

    • Default value localTime: Date = new Date()

    Returns LogObj

    {LogObj} Wrapper object for log record

Private getLogBufferReference

  • getLogBufferReference(logLevel: LOG_LEVEL): LogObj[]
  • Parameters

    Returns LogObj[]

Private getLoggerEndpoint

  • getLoggerEndpoint(logLevel: LOG_LEVEL): string
  • Parameters

    Returns string

Protected getTabIdFromSession

  • getTabIdFromSession(): void
  • Retrieves the session ID from browser session storage, or generates a new one if not already present. The session ID helps to differentiate app logs if duplicate instances of the parent DaVinci App are loaded in multiple tabs.

    memberof

    AbstractLogger

    Returns void

logCritical

  • logCritical(message: string, errorCode?: ERROR_CODE, localTime?: Date): void
  • Parameters

    • message: string
    • Default value errorCode: ERROR_CODE = ERROR_CODE.Other
    • Default value localTime: Date = new Date()

    Returns void

logCriticial

  • logCriticial(message: string, errorCode?: ERROR_CODE, localTime?: Date): void
  • Create a CRITICAL log. Deprecated, behaves the same as logCritical()

    deprecated
    memberof

    AbstractLogger

    Parameters

    • message: string

      Content of log record

    • Default value errorCode: ERROR_CODE = ERROR_CODE.Other

      Error classification

    • Default value localTime: Date = new Date()

      Local time when log record was generated

    Returns void

logDebug

  • logDebug(message: string, errorCode?: ERROR_CODE, localTime?: Date): void
  • Parameters

    • message: string
    • Default value errorCode: ERROR_CODE = ERROR_CODE.Other
    • Default value localTime: Date = new Date()

    Returns void

logError

  • logError(message: string, errorCode?: ERROR_CODE, localTime?: Date): void
  • Parameters

    • message: string
    • Default value errorCode: ERROR_CODE = ERROR_CODE.Other
    • Default value localTime: Date = new Date()

    Returns void

logInformation

  • logInformation(message: string, errorCode?: ERROR_CODE, localTime?: Date): void
  • Parameters

    • message: string
    • Default value errorCode: ERROR_CODE = ERROR_CODE.Other
    • Default value localTime: Date = new Date()

    Returns void

logLoop

  • logLoop(message: string, errorCode?: ERROR_CODE, localTime?: Date): void
  • Parameters

    • message: string
    • Default value errorCode: ERROR_CODE = ERROR_CODE.Other
    • Default value localTime: Date = new Date()

    Returns void

Private logMessage

  • logMessage(methodLogLevel: LOG_LEVEL, message: string, errorCode: ERROR_CODE, localTime: Date): void
  • Parameters

    Returns void

logTrace

  • logTrace(message: string, errorCode?: ERROR_CODE, localTime?: Date): void
  • Parameters

    • message: string
    • Default value errorCode: ERROR_CODE = ERROR_CODE.Other
    • Default value localTime: Date = new Date()

    Returns void

logWarning

  • logWarning(message: string, errorCode?: ERROR_CODE, localTime?: Date): void
  • Parameters

    • message: string
    • Default value errorCode: ERROR_CODE = ERROR_CODE.Other
    • Default value localTime: Date = new Date()

    Returns void

Private postBuffers

  • Parameters

    Returns void

Private postBuffersAsync

  • postBuffersAsync(logLevel: LOG_LEVEL): Promise<void>
  • Parameters

    Returns Promise<void>

Private printConsoleLog

  • printConsoleLog(logObj: LogObj): void
  • Parameters

    • logObj: LogObj

    Returns void

pushLogs

  • pushLogs(): void

pushLogsAsync

  • pushLogsAsync(): Promise<void>

setConfiguration

Protected syncLogLevel

  • syncLogLevel(): void
  • This method will sync the logLevel with account level log level of the logged in user. User has to be logged in before calling this method.

    Returns void

Protected uuidv4

  • uuidv4(): string
  • Generates a random UUID. Method of generation is not secure. Only use this method to generate UUIDs if the UUID cannot be used to compromise data and system security.

    memberof

    AbstractLogger

    Returns string

    {string} A randomly generated UUID

Generated using TypeDoc