Options
All
  • Public
  • Public/Protected
  • All
Menu

A class used to indicate the logging level of a message sent to the LogService.

Hierarchy

Index

Properties

Static DEBUG

DEBUG: LogLevelType = ...

Log level used for debug logging. By default, debug logging is only kept when the process is running in a
testing or development environment, unless otherwise configured.

static

Static ERROR

ERROR: LogLevelType = ...

Log level used for indicating errors during runtime of the process.

static

Static FATAL

FATAL: LogLevelType = ...

Log level used for indicating fatal errors during runtime of the process. These are errors that the process
is unable to recover from and needs to restart.

static

Static INFO

INFO: LogLevelType = ...

Log level used for general purpose logging.

static

Static NONE

NONE: LogLevelType = ...

Log level used for when content needs to be logged without the LogLevelType associated with it in
either the console, or the LogEntry.

static

Static SUPPORTED_TYPES

SUPPORTED_TYPES: LogLevelType[] = ...

An array of all the supported LogLevelType values. Anything not in this array is either not currently supported,
deprecated, or an invalid LogLevelType.

static

Static WARN

WARN: LogLevelType = ...

Log level used for indicating warnings during runtime of the process.

static

Static Protected TYPE

TYPE: string = "LogLevelType"

Variable used to hold the type information for the LogLevelType class, which is used to build the
LogLevelType's representation when converted to a string.

static

Protected Readonly chalkColor

chalkColor: Chalk

An instance of the Chalk dependency, which is used to provide color to log content displayed to the
console.

see

Chalk

readonly

Protected code

code: string

The code for the CustomType. Required.

Protected Readonly logValue

logValue: number

A numerical representation for the log level, used to indicate if the log level priority.

readonly

Protected text

text: string

The text readable value for the CustomType. Required.

Protected type

type: string

The CustomType defined as a string value. Required.

Methods

Static getClassType

  • getClassType(): string

Static getLogLevelType

  • Helper method that gets the LogLevelType associated with the provided string value.

    static
    throws

    {Error} Throws an error when a string is provided that does not map to a LogLevelType in
    LogLevelType.SUPPORTED_TYPES array.

    Parameters

    • logLevel: string

    Returns LogLevelType

    The LogLevelType that maps to the provided string.

Static isEqual

  • Checks if two CustomTypes are equal to each other or not.

    static

    Parameters

    • customType1: CustomType

      The first CustomType to check with.

    • customType2: CustomType

      The second CustomType to check with.

    Returns boolean

    True if the CustomTypes are equal, otherwise false.

Static isStrictEqual

Static toString

  • toString(): string

Static validateType

  • Validates that a supplied LogLevelType is valid.

    static

    Parameters

    Returns boolean

    True if the provided LogLevelType is valid, otherwise false.

getChalkColor

  • getChalkColor(): Chalk

getCode

  • getCode(): string

getText

  • getText(): string

getType

  • getType(): string

isDebug

  • isDebug(): boolean

isDebugOrGreater

  • isDebugOrGreater(): boolean
  • Indicates if the LogLevelType is debug or greater.

    Returns boolean

    True if the LogLevelType is debug or greater, otherwise false.

isEqual

  • Checks if a CustomType is equal to a provided CustomType.

    Parameters

    • customType: CustomType

      The CustomType to compare.

    Returns boolean

    True if the provided CustomType is equal to the current CustomType, otherwise false.

isError

  • isError(): boolean

isErrorOrGreater

  • isErrorOrGreater(): boolean
  • Indicates if the LogLevelType is Error or greater.

    Returns boolean

    True if the LogLevelType is error or greater, otherwise false.

isFatal

  • isFatal(): boolean

isGreaterThan

  • Indicates if the provided log level is greater than the log level instance.

    Parameters

    Returns boolean

    True if the provided log level is greater, otherwise false.

isGreaterThanOrEqual

  • Indicates if the provided log level is greater than or equal to the log level instance.

    Parameters

    Returns boolean

    True if the provided log level is greater than or equal, otherwise false.

isInfo

  • isInfo(): boolean

isInfoOrGreater

  • isInfoOrGreater(): boolean
  • Indicates if the LogLevelType is info or greater.

    Returns boolean

    True if the LogLevelType is info or greater, otherwise false.

isNone

  • isNone(): boolean

isStrictEqual

  • Strictly checks if a CustomType is equal to a provided CustomType.

    Parameters

    • customType: CustomType

      The CustomType to compare.

    Returns boolean

    True if the provided CustomType is strict equal to the current CustomType, otherwise false.

isValid

  • isValid(): (string | boolean)[]
  • Validation method for the CustomType class. Ensures that a CustomType is built correctly.

    Returns (string | boolean)[]

    An array with a true/false value indicating if the CustomType is valid
    or not, and either an empty string when valid, or a string containing the error message when invalid.

isWarn

  • isWarn(): boolean

isWarnOrGreater

  • isWarnOrGreater(): boolean
  • Indicates if the LogLevelType is warn or greater.

    Returns boolean

    True if the LogLevelType is warn or greater, otherwise false.

toString

  • toString(): string

Constructors

constructor

  • new LogLevelType(code: string, text: string, chalkColor: Chalk, logValue: number): LogLevelType
  • Creates an instance of the LogLevel type.

    Parameters

    • code: string

      The code for the LogLevelType.

    • text: string

      The readable value of the LogLevelType.

    • chalkColor: Chalk

      A color from the chalk API that is used when displaying content to the console.

    • logValue: number

      A numerical representation of the log level, used to indicate log level severity.

    Returns LogLevelType

Generated using TypeDoc