Skip to content

Loggical API Documentation v1.0.1


Loggical API Documentation / LogLevel

Variable: LogLevel

ts
const LogLevel: {
  DEBUG: 0;
  INFO: 1;
  WARN: 2;
  ERROR: 3;
  HIGHLIGHT: 4;
  FATAL: 5;
};

Defined in: types/core.types.ts:27

Available log levels with their numeric priorities

Lower numbers indicate higher priority/verbosity:

  • DEBUG (0): Detailed diagnostic information, typically disabled in production
  • INFO (1): General informational messages about application flow
  • WARN (2): Warning conditions that don't halt execution but need attention
  • ERROR (3): Error conditions that don't require immediate termination
  • HIGHLIGHT (4): Important information that needs special attention
  • FATAL (5): Critical errors that may terminate the application

Type Declaration

DEBUG

ts
readonly DEBUG: 0 = 0;

INFO

ts
readonly INFO: 1 = 1;

WARN

ts
readonly WARN: 2 = 2;

ERROR

ts
readonly ERROR: 3 = 3;

HIGHLIGHT

ts
readonly HIGHLIGHT: 4 = 4;

FATAL

ts
readonly FATAL: 5 = 5;

Example

typescript
import { LogLevel } from 'loggical'

const logger = new Logger({ minLevel: LogLevel.INFO })
logger.debug('This will not be shown')  // Below INFO level
logger.info('This will be shown')       // INFO level and above

Released under the MIT License.