SixL client API / system / ConsoleMp

Interface: ConsoleMp

The console: writes lines to the client's log.

Remarks

The lines go to the core's log, not to an in-game console: the game has no console window, so clear and reset do nothing. verbosity filters this object's lines; console.log and the runtime's own lines are not filtered.

Example

mp.console.logInfo('client started');

Properties

verbosity

verbosity: string

The lowest level of mp.console lines that are written: 'info' (all, the start value), 'warning', 'error' or 'fatal'. A line below it is dropped.

Remarks

Only the log* methods of mp.console are filtered; an unknown value lets every line through.

Example

mp.console.verbosity = 'warning';
    mp.console.logInfo('not written');
    mp.console.logWarning('written');

Methods

clear()

clear(): void

Clears the game console. There is no game console, so it does nothing.

Returns

void

Remarks

Partial: no effect; the log is not cleared.

Example

mp.console.clear();

logError()

logError(message, save?, saveAsync?): void

Logs an error line.

Parameters

message

string

The text. Any value is converted to a string.

save?

boolean

Accepted for RAGE MP compatibility; ignored (the line is always written to the log).

saveAsync?

boolean

Accepted for RAGE MP compatibility; ignored.

Returns

void

Example

mp.console.logError('could not save the settings');

logFatal()

logFatal(message, save?, saveAsync?): void

Logs a fatal line. It is written to the core's log with the fatal level; nothing is stopped.

Parameters

message

string

The text. Any value is converted to a string.

save?

boolean

Accepted for RAGE MP compatibility; ignored (the line is always written to the log).

saveAsync?

boolean

Accepted for RAGE MP compatibility; ignored.

Returns

void

Example

mp.console.logFatal('the settings file is corrupt');

logInfo()

logInfo(message, save?, saveAsync?): void

Logs an informational line.

Parameters

message

string

The text. Any value is converted to a string.

save?

boolean

Accepted for RAGE MP compatibility; ignored (the line is always written to the log).

saveAsync?

boolean

Accepted for RAGE MP compatibility; ignored.

Returns

void

Example

mp.console.logInfo('loaded ' + count + ' items');

logWarning()

logWarning(message, save?, saveAsync?): void

Logs a warning line.

Parameters

message

string

The text. Any value is converted to a string.

save?

boolean

Accepted for RAGE MP compatibility; ignored (the line is always written to the log).

saveAsync?

boolean

Accepted for RAGE MP compatibility; ignored.

Returns

void

Example

mp.console.logWarning('no config, using defaults');

reset()

reset(): void

Resets the game console. There is no game console, so it does nothing.

Returns

void

Remarks

Partial: no effect.

Example

mp.console.reset();