@eveble/eveble

Index

Namespaces

Enumerations

Classes

Type aliases

Variables

Functions

Object literals

Type aliases

ConstructorType

Ƭ ConstructorType: ConstructorType‹T›


EntityType

Ƭ EntityType: EntityType‹T›


Mappings

Ƭ Mappings: Record‹keyof any, inversifyTypes.Metadata[]›


Stringifiable

Ƭ Stringifiable: Stringifiable

Variables

Const COMMANDS_KEY

COMMANDS_KEY: keyof symbol = Symbol('eveble:commands')


Const COMMAND_HANDLERS_CONTAINER_KEY

COMMAND_HANDLERS_CONTAINER_KEY: keyof symbol = Symbol( 'eveble:container:command-handlers' )


Const CommandBus_base

CommandBus_base: object & SuperConstructorSelector‹HookableMixin | OneToOneHandlingMixin› & object & object & object


Const CommitReceiver_base

CommitReceiver_base: object & SuperConstructorSelector‹StatefulMixin | Serializable› & object & object & object


Const DEFAULT_PROPS_KEY

DEFAULT_PROPS_KEY: symbol = CORE_METADATA_KEYS.DEFAULT_PROPS_KEY


Const DELEGATED_KEY

DELEGATED_KEY: keyof symbol = Symbol('eveble🎏delegated')


Const EVENTS_KEY

EVENTS_KEY: keyof symbol = Symbol('eveble:events')


Const EVENT_HANDLERS_CONTAINER_KEY

EVENT_HANDLERS_CONTAINER_KEY: keyof symbol = Symbol( 'eveble:container:event-handlers' )


Const Entity_base

Entity_base: object & SuperConstructorSelector‹StatefulMixin | Serializable | StatusfulMixin› & object & object & object & object


Const EventBus_base

EventBus_base: object & SuperConstructorSelector‹HookableMixin | OneToManyHandlingMixin› & object & object & object


Const EventSourceable_base

EventSourceable_base: object & SuperConstructorSelector‹Entity | OneToOneHandlingMixin› & object & object & object


Const HANDLEABLE_TYPES

HANDLEABLE_TYPES: keyof symbol = Symbol( 'eveble:handleable-types' )


Const HANDLERS

HANDLERS: keyof symbol = Symbol('eveble:handlers')


Const HANDLER_KEY

HANDLER_KEY: keyof symbol = Symbol('eveble:controller:handler')


Const HOOKABLE_KEY

HOOKABLE_KEY: keyof symbol = Symbol('eveble🎏hookable')


Const HOOKS_CONTAINER_KEY

HOOKS_CONTAINER_KEY: keyof symbol = Symbol( 'eveble:containers:hooks' )


Const INITIALIZING_MESSAGE_KEY

INITIALIZING_MESSAGE_KEY: keyof symbol = Symbol( 'eveble:controller:initializing-message' )


Const LEGACY_TRANSFORMERS_CONTAINER_KEY

LEGACY_TRANSFORMERS_CONTAINER_KEY: keyof symbol = Symbol( 'eveble:container:legacy-transformers' )


Const LIST_KEY

LIST_KEY: keyof symbol = Symbol('eveble:list-key')


Const Logger_base

Logger_base: object & SuperConstructorSelector‹StatefulMixin | RFC5424LoggingMixin› & object & object & object


Const Module_base

Module_base: object & SuperConstructorSelector‹StatefulMixin› & object & object


Const Projection_base

Projection_base: object & SuperConstructorSelector‹StatefulMixin | EventHandlingMixin› & object & object & object


Const ROLLBACK_STATE_METHOD_KEY

ROLLBACK_STATE_METHOD_KEY: keyof symbol = Symbol( 'eveble:rollback-state' )


Const ROUTED_COMMANDS_CONTAINER_KEY

ROUTED_COMMANDS_CONTAINER_KEY: keyof symbol = Symbol( 'eveble:container:routed-commands' )


Const ROUTED_EVENTS_CONTAINER_KEY

ROUTED_EVENTS_CONTAINER_KEY: keyof symbol = Symbol( 'eveble:container:routed-events' )


Const SAVED_STATE_KEY

SAVED_STATE_KEY: keyof symbol = Symbol('eveble:saved-state')


Const SAVE_STATE_METHOD_KEY

SAVE_STATE_METHOD_KEY: keyof symbol = Symbol('eveble:save-state')


Const SERIALIZABLE_LIST_PROPS_KEY

SERIALIZABLE_LIST_PROPS_KEY: symbol = CORE_METADATA_KEYS.SERIALIZABLE_LIST_PROPS_KEY


Const SERIALIZABLE_TYPE_KEY

SERIALIZABLE_TYPE_KEY: keyof symbol = Symbol( 'eveble:serializable-type' )


Const SOURCE_KEY

SOURCE_KEY: keyof symbol = Symbol('eveble:source')


Const SUBSCRIBER_KEY

SUBSCRIBER_KEY: keyof symbol = Symbol( 'eveble:controller:subscriber' )


Const ScheduledJob_base

ScheduledJob_base: object & SuperConstructorSelector‹StatefulMixin | Struct› & object & object & object


Const SerializableError_base

SerializableError_base: object & SuperConstructorSelector‹ExtendableError | DefinableMixin | HookableMixin | EjsonableMixin | VersionableMixin› & object & object & object & object & object & object


Const Serializable_base

Serializable_base: object & SuperConstructorSelector‹Struct | EjsonableMixin | VersionableMixin› & object & object & object & object


Const Service_base

Service_base: object & SuperConstructorSelector‹CommandHandlingMixin | EventHandlingMixin› & object & object & object


Const Struct_base

Struct_base: object & SuperConstructorSelector‹DefinableMixin | HookableMixin› & object & object & object


Const TYPE_KEY

TYPE_KEY: "_type" = "_type"


Const VERSIONABLE_KEY

VERSIONABLE_KEY: keyof symbol = Symbol('eveble:versionable')


Const env

env: string = process.env.NODE_ENV


Const envFile

envFile: string = process.env.NODE_ENV ? .env.${env} : '.env'

Functions

bindExternalDependencies

bindExternalDependencies(injector: Injector): void

Binds external dependencies to Injector.

Parameters:

NameTypeDescription
injectorInjectorIoC container implementing Injector interface.

Returns: void


bindLoggerDependencies

bindLoggerDependencies(injector: Injector): void

Binds logger dependencies to Injector.

Parameters:

NameTypeDescription
injectorInjectorIoC container implementing Injector interface.

Returns: void


convertObjectToCollection

convertObjectToCollection(obj: any): Record‹keyof any, any›

Converts root-level objects to collection.

Parameters:

NameTypeDescription
objanyObject that should be converted.

Returns: Record‹keyof any, any›

Instance of Collection pattern with properties from object.


createConsoleTransport

createConsoleTransport(level: LogLevel, transportConfig: LogTransportConfig): ConsoleTransport

Creates a ConsoleTransport.

Parameters:

NameTypeDefaultDescription
levelLogLevel-Level for which priority logging will only be done(less than or equal to this level) on ConsoleTransport.
transportConfigLogTransportConfignew LogTransportConfig()-

Returns: ConsoleTransport


Const createEJSON

createEJSON(): any

Creates instance of EJSON.

remarks By default, EJSON module stores types in variable that is not referenced on the EJSON object itself. This creates issue when running tests in watch modes(like Mocha's --watch) since the state of EJSON is cached.

Returns: any

De-cached version of EJSON module.


createLogger

createLogger(levels?: LogLevels): Logger

Creates an instance of Logger.

Parameters:

NameTypeDescription
levels?LogLevelsOptional logging levels for logger.

Returns: Logger


delegate

delegate(): function

Returns: function

▸ (target: Record‹string, any›): void

Parameters:

NameType
targetRecord‹string, any›

executePostConstruct

executePostConstruct(target: any): void

Executes annotated by @postConstruct post construction method on target.

Parameters:

NameTypeDescription
targetanyInstance that has @postConstruct annotation applied to method.

Returns: void


executePostConstructAsync

executePostConstructAsync(target: any): Promise‹void›

Executes annotated by @postConstruct post construction method on target.

async

Parameters:

NameTypeDescription
targetanyInstance that has @postConstruct annotation applied to method.

Returns: Promise‹void›


Const getCollectionName

getCollectionName(targetName: string): string

Parameters:

NameType
targetNamestring

Returns: string


Const getDatabaseName

getDatabaseName(targetName: string): string

Parameters:

NameType
targetNamestring

Returns: string


Const getUrl

getUrl(targetName: string): string

Parameters:

NameType
targetNamestring

Returns: string


handle

handle(target: Record‹string, any›, methodName: string, index: number): void

Annotates method parameter as a handler for Command type(or other) - type that is used as first method parameter(i.e. for example below MyCommandHandlingMethod with parameter MyCommand).

remarks Since decorator is executed before class instance is ever created, we need to solve the issue of registered handlers leaking in between multiple classes when inheritance is involved.

To solve that - we create a container on metadata that holds all registered types and handlers. Then, whenever a class is instantiated - we resolve that container through Reflect.getOwnMetadata to ensure that only metadata assigned to class is resolved and then - iterate through that container on construction and register all the assigned types and handlers.

Implementation of this can be seen on OneToOneHandlingMixin or OneToManyHandlingMixin constructors.

example

@define('MyCommand')
class MyCommand extends Command<MyCommand> {
key: string;
}
class MyClass extends OneToOneHandlingMixin {
MyCommandHandlingMethod(@handle command: MyCommand) {
return true;
}
}
const instance = new MyClass();
expect(instance.getHandlers()).to.be.eql(
new Map([[MyCommand, instance.MyCommandHandlingMethod]])
);

Parameters:

NameTypeDescription
targetRecord‹string, any›Target which method parameter is being decorated.
methodNamestringMethod name which parameter is being decorated.
indexnumberIndex number of the parameter that is being decorated.

Returns: void


hasPostConstruct

hasPostConstruct(target: any): boolean

Evaluates if @postConstruct(from Inversify) annotation is applied to target's method.

Parameters:

NameTypeDescription
targetanyInstance of evaluated argument.

Returns: boolean

Returns true if target's constructor has @postConstruct annotation applied, else false.


initial

initial(target: Record‹string, any›, methodName: string, index: number): void

Annotates method parameter as a handler for initial Command or Event type(or other) - type that is used as first method parameter.

remarks Since decorator is executed before class instance is ever created, we need to solve the issue of registered handlers leaking in between multiple classes when inheritance is involved.

To solve that - we create a container on metadata that holds all registered types and handlers. Then, whenever a class is instantiated - we resolve that container through Reflect.getOwnMetadata to ensure that only metadata assigned to class is resolved and then - iterate through that container on construction and register all the assigned types and handlers.

Implementation of this can be seen on OneToOneHandlingMixin or OneToManyHandlingMixin constructors.

example

@define('MyCommand')
class MyCommand extends Command<MyCommand> {
key: string;
}
class MyClass extends OneToOneHandlingMixin {
MyInitialCommand(@initial command: MyCommand) {
return true;
}
}
expect(MyClass.resolveInitializingMessage()).to.be.equal(
MyCommand
);

example

@define('MyEvent')
class MyEvent extends Event<MyEvent> {
key: string;
}
class MyClass extends OneToOneHandlingMixin {
MyInitialEvent(@initial event: MyEvent) {
return true;
}
}
expect(MyClass.resolveInitializingMessage()).to.be.equal(
MyEvent
);

Parameters:

NameTypeDescription
targetRecord‹string, any›Target which method parameter is being decorated.
methodNamestringMethod name which parameter is being decorated.
indexnumberIndex number of the parameter that is being decorated.

Returns: void


isDefinable

isDefinable(arg: any): boolean

Evaluates if provided argument is a Definable implementation.

Parameters:

NameTypeDescription
arganyInstance of evaluated argument.

Returns: boolean

Returns true if provided argument is implementing Definable interface, else false.


isEventSourceableType

isEventSourceableType(arg: any): boolean

Evaluates if provided argument is a EventSourceable type constructor implementation.

Parameters:

NameTypeDescription
arganyConstructor of evaluated argument.

Returns: boolean

Returns true if provided argument is implementing EventSourceableType interface, else false.


isPlainRecord

isPlainRecord(arg: any): boolean

Evaluates if provided argument is a plain record(plain object or Collection).

Parameters:

NameTypeDescription
arganyEvaluated argument.

Returns: boolean

Returns true if argument is an record(literal object or Collection instance), else false.


isRecord

isRecord(arg: any): boolean

Evaluates if provided argument is a record.

Parameters:

NameTypeDescription
arganyEvaluated argument.

Returns: boolean

Returns true if argument is an record(literal object, class instance or Collection instance), else false.


Const isSSL

isSSL(targetName: string): boolean

Parameters:

NameType
targetNamestring

Returns: boolean


loadENV

loadENV(envFilePath: string): void

Assigns environment variables based on environment.

Parameters:

NameTypeDescription
envFilePathstringPath to env file.

Returns: void


loggerLoader

loggerLoader(injector: Injector, level: LogLevel, consoleTransportConfig?: LogTransportConfig, levels?: LogLevels): Logger

Bootstraps creation of Logger instance.

Parameters:

NameTypeDescription
injectorInjectorIoC container implementing Injector interface
levelLogLevelLevel for which priority logging will only be done(less than or equal to this level) on ConsoleTransport.
consoleTransportConfig?LogTransportConfigOptional LogTransportConfig instance.
levels?LogLevelsOptional logging levels for logger.

Returns: Logger

Logger instance.


route

route(target: Record‹string, any›, methodName: string, index: number): void

Annotates method parameter as a handler for routed Command or Event type(or other) - type that is used as first method parameter.

remarks Since decorator is executed before class instance is ever created, we need to solve the issue of registered handlers leaking in between multiple classes when inheritance is involved.

To solve that - we create a container on metadata that holds all registered types and handlers. Then, whenever a class is instantiated - we resolve that container through Reflect.getOwnMetadata to ensure that only metadata assigned to class is resolved and then - iterate through that container on construction and register all the assigned types and handlers.

Implementation of this can be seen on OneToOneHandlingMixin or OneToManyHandlingMixin constructors.

example

@define('MyCommand')
class MyCommand extends Command<MyCommand> {
key: string;
}
class MyClass extends OneToOneHandlingMixin {
MyCommand(@route command: MyCommand) {
return true;
}
}
const instance = new MyClass();
expect(instance.resolveRoutedCommands()).to.be.eql([MyCommand]);

example

@define('MyEvent')
class MyEvent extends Event<MyEvent> {
key: string;
}
class MyClass extends OneToOneHandlingMixin {
MyEvent(@route command: MyEvent) {
return true;
}
}
const instance = new MyClass();
expect(instance.resolveRoutedEvents()).to.be.eql([MyEvent]);

Parameters:

NameTypeDescription
targetRecord‹string, any›Target which method parameter is being decorated.
methodNamestringMethod name which parameter is being decorated.
indexnumberIndex number of the parameter that is being decorated.

Returns: void


Const setupCommitStoreMongo

setupCommitStoreMongo(injector: Injector, clients: Record‹string, Client›, collections: Record‹string, Collection›): Promise‹object›

Parameters:

NameType
injectorInjector
clientsRecord‹string, Client›
collectionsRecord‹string, Collection›

Returns: Promise‹object›


setupInjector

setupInjector(): object

Returns: object

  • config: any

  • injector: Injector

  • log: any


Const setupSchedulerMongo

setupSchedulerMongo(injector: Injector, clients: Record‹string, Client›, collections: Record‹string, Collection›): Promise‹object›

Parameters:

NameType
injectorInjector
clientsRecord‹string, Client›
collectionsRecord‹string, Collection›

Returns: Promise‹object›


Const setupSnapshotterMongo

setupSnapshotterMongo(injector: Injector, clients: Record‹string, Client›, collections: Record‹string, Collection›): Promise‹object›

Parameters:

NameType
injectorInjector
clientsRecord‹string, Client›
collectionsRecord‹string, Collection›

Returns: Promise‹object›


sleep

sleep(ms: number): Promise‹any›

Parameters:

NameType
msnumber

Returns: Promise‹any›


subscribe

subscribe(target: Record‹string, any›, propertyName: string, index: number): void

Annotates method as a handler for type(Event or other)- type that is used as first method parameter(i.e. for example below MyEvent).

remarks Since decorator is executed before class instance is ever created, we need to solve the issue of registered handlers leaking in between multiple classes when inheritance is involved.

To solve that - we create a container on metadata that holds all registered types and handlers. Then, whenever a class is instantiated - we resolve that container through Reflect.getOwnMetadata to ensure that only metadata assigned to class is resolved and then - iterate through that container on construction and register all the assigned types and handlers.

Implementation of this can be seen on OneToOneHandlingMixin or OneToManyHandlingMixin constructors.

example

@define('MyEvent')
class MyEvent extends Event<MyEvent> {
key: string;
}
class MyClass extends OneToOneHandlingMixin {
MyEventHandlingMethod(@subscribe event: MyEvent) {
return true;
}
}
const instance = new MyClass();
expect(instance.getHandlers()).to.be.eql(
new Map([[MyEvent, instance.MyEventHandlingMethod]])
);

Parameters:

NameTypeDescription
targetRecord‹string, any›Target which method parameter is being decorated.
propertyNamestring-
indexnumberIndex number of the parameter that is being decorated.

Returns: void


toPlainObject

toPlainObject(arg: Record‹keyof any, any›): Record‹keyof any, any›

Converts object and all nested records implementing DefinableMixin to plain object.

Parameters:

NameTypeDescription
argRecord‹keyof any, any›Object or instance of a class for conversion.

Returns: Record‹keyof any, any›

Plain object representation of provided argument.


version

versionT›(schemaVersion: number): any

Annotates legacy schema transformer method on a class that will used for processing legacy properties(data).

example

// In the best interest of future developer's sanity is to keep track
// of previous type versions. You can define previous prop types of a class as type
// and assign it as generic type at @version<T>(schemaVersion: number)
type CustomerV0 = {
firstName: string;
lastName: string;
city: string;
street: string;
};
@define('Customer')
class Customer extends Serializable {
name: string;
address: string;
@version<CustomerV0>(1)
transformToVersion1(props: types.Props): types.Props {
props.name = `${props.firstName} ${props.lastName}`;
props.address = `${props.city}, ${props.street}`;
delete props.firstName;
delete props.lastName;
delete props.city;
delete props.street;
return props;
}
}

Type parameters:

T

Parameters:

NameTypeDescription
schemaVersionnumberSchema version for which legacy transformation will be done.

Returns: any

Object literals

Const BINDINGS

BINDINGS: object

App

App: symbol = Symbol.for('App')

Asserter

Asserter: symbol = Symbol.for('Asserter')

CommandBus

CommandBus: symbol = Symbol.for('CommandBus')

CommandScheduler

CommandScheduler: symbol = Symbol.for('CommandScheduler')

CommandSchedulingService

CommandSchedulingService: symbol = Symbol.for('CommandSchedulingService')

CommitObserver

CommitObserver: symbol = Symbol.for('CommitObserver')

CommitPublisher

CommitPublisher: symbol = Symbol.for('CommitPublisher')

CommitSerializer

CommitSerializer: symbol = Symbol.for('CommitSerializer')

CommitStorage

CommitStorage: symbol = Symbol.for('CommitStorage')

CommitStore

CommitStore: symbol = Symbol.for('CommitStore')

Config

Config: symbol = Symbol.for('Config')

Converter

Converter: symbol = Symbol.for('Converter')

Describer

Describer: symbol = Symbol.for('Describer')

DetailedLogFormatter

DetailedLogFormatter: symbol = Symbol.for('DetailedLogFormatter')

EJSON

EJSON: symbol = Symbol.for('EJSON')

EventBus

EventBus: symbol = Symbol.for('EventBus')

EventSourceableRepository

EventSourceableRepository: symbol = Symbol.for('EventSourceableRepository')

Injector

Injector: symbol = Symbol.for('Injector')

Library

Library: symbol = Symbol.for('Library')

LogConverter

LogConverter: symbol = Symbol.for('LogConverter')

Router

Router: symbol = Symbol.for('Router')

Serializer

Serializer: symbol = Symbol.for('Serializer')

SimpleLogFormatter

SimpleLogFormatter: symbol = Symbol.for('SimpleLogFormatter')

SnapshotSerializer

SnapshotSerializer: symbol = Symbol.for('SnapshotSerializer')

SnapshotStorage

SnapshotStorage: symbol = Symbol.for('SnapshotStorage')

Snapshotter

Snapshotter: symbol = Symbol.for('Snapshotter')

Validator

Validator: symbol = Symbol.for('Validator')

chalk

chalk: symbol = Symbol.for('chalk')

console

console: string = "console"

log

log: symbol = Symbol.for('Logger')

winston

winston: symbol = Symbol.for('winston')

Agenda: object

  • jobTransformer: symbol = Symbol.for('Agenda.jobTransformer')

  • library: symbol = Symbol.for('Agenda.library')

  • clients: object

    • CommandScheduler: symbol = Symbol.for('Agenda.clients.CommandScheduler')

MongoDB: object

  • library: symbol = Symbol.for('MongoDB.library')

  • clients: object

    • CommandScheduler: symbol = Symbol.for('MongoDB.clients.CommandScheduler')

    • CommitStore: symbol = Symbol.for('MongoDB.clients.CommitStore')

    • Snapshotter: symbol = Symbol.for('MongoDB.clients.Snapshotter')

  • collections: object

    • Commits: symbol = Symbol.for('MongoDB.collections.Commits')

    • ScheduledCommands: symbol = Symbol.for('MongoDB.collections.ScheduledCommands')

    • Snapshots: symbol = Symbol.for('MongoDB.collections.Snapshots')


Const DEFAULTS

DEFAULTS: object

LOGGING_LEVELS

LOGGING_LEVELS: object

Type declaration:

  • alert: number = 1

  • crit: number = 2

  • debug: number = 7

  • emerg: number = 0

  • error: number = 3

  • info: number = 6

  • notice: number = 5

  • warning: number = 4


Const LITERAL_KEYS

LITERAL_KEYS: object

COMMANDS_KEY

COMMANDS_KEY: symbol

EVENTS_KEY

EVENTS_KEY: symbol

HANDLEABLE_TYPES

HANDLEABLE_TYPES: symbol

HANDLERS

HANDLERS: symbol

LIST_KEY

LIST_KEY: symbol

ROLLBACK_STATE_METHOD_KEY

ROLLBACK_STATE_METHOD_KEY: symbol

SAVED_STATE_KEY

SAVED_STATE_KEY: symbol

SAVE_STATE_METHOD_KEY

SAVE_STATE_METHOD_KEY: symbol

SERIALIZABLE_TYPE_KEY

SERIALIZABLE_TYPE_KEY: symbol

SOURCE_KEY

SOURCE_KEY: symbol

TYPE_KEY

TYPE_KEY: string


Const LOGGING_LEVELS

LOGGING_LEVELS: object

alert

alert: number = 1

crit

crit: number = 2

debug

debug: number = 7

emerg

emerg: number = 0

error

error: number = 3

info

info: number = 6

notice

notice: number = 5

warning

warning: number = 4


Const METADATA_KEYS

METADATA_KEYS: object

COMMAND_HANDLERS_CONTAINER_KEY

COMMAND_HANDLERS_CONTAINER_KEY: symbol

DEFAULT_PROPS_KEY

DEFAULT_PROPS_KEY: symbol

DELEGATED_KEY

DELEGATED_KEY: symbol

EVENT_HANDLERS_CONTAINER_KEY

EVENT_HANDLERS_CONTAINER_KEY: symbol

HANDLER_KEY

HANDLER_KEY: symbol

HOOKABLE_KEY

HOOKABLE_KEY: symbol

HOOKS_CONTAINER_KEY

HOOKS_CONTAINER_KEY: symbol

INITIALIZING_MESSAGE_KEY

INITIALIZING_MESSAGE_KEY: symbol

LEGACY_TRANSFORMERS_CONTAINER_KEY

LEGACY_TRANSFORMERS_CONTAINER_KEY: symbol

ROUTED_COMMANDS_CONTAINER_KEY

ROUTED_COMMANDS_CONTAINER_KEY: symbol

ROUTED_EVENTS_CONTAINER_KEY

ROUTED_EVENTS_CONTAINER_KEY: symbol

SERIALIZABLE_LIST_PROPS_KEY

SERIALIZABLE_LIST_PROPS_KEY: symbol

SUBSCRIBER_KEY

SUBSCRIBER_KEY: symbol

VERSIONABLE_KEY

VERSIONABLE_KEY: symbol


Const RFC5424

RFC5424: object

alert

alert: number = 1

crit

crit: number = 2

debug

debug: number = 7

emerg

emerg: number = 0

error

error: number = 3

info

info: number = 6

notice

notice: number = 5

warning

warning: number = 4


Const SPECIFICATIONS

SPECIFICATIONS: object

RFC5424

RFC5424: object

Type declaration:

  • alert: number = 1

  • crit: number = 2

  • debug: number = 7

  • emerg: number = 0

  • error: number = 3

  • info: number = 6

  • notice: number = 5

  • warning: number = 4