LoggerService

Learn more about Logger Service

Introduction

The LoggerService is a wrapper around the alt:V log feature. It's created to fit the object-oriented requirements. We had to improve some parts for logging to help you out.

LoggerService is available on both sides

Available Methods

This section describes the available methods that you can use.

info(...messages: any[])

This logs the message 'Your message' as a default log

@singleton()
export class YourClass {

    constructor(
        private readonly loggerService: LoggerService
    ) {}

    public yourMethod(): void {
        this.loggerService.info('Your message')
    }
}

warning(...messages: any[])

This logs the message 'Your message' as a warning

@singleton()
export class YourClass {

    constructor(
        private readonly loggerService: LoggerService
    ) {}

    public yourMethod(): void {
        this.loggerService.warning('Your message')
    }
}

error(...messages: any[])

This logs the message 'Your message' as an error

@singleton()
export class YourClass {

    constructor(
        private readonly loggerService: LoggerService
    ) {}

    public yourMethod(): void {
        this.loggerService.error('Your message')
    }
}

Last updated