src/helpers/info-logger.ts
Logger for logging event display data
Properties |
|
Methods |
Private infoLoggerList |
Type : any[]
|
Default value : []
|
Defined in src/helpers/info-logger.ts:6
|
List that contains all the info logs |
Private maxEntries |
Type : number
|
Default value : 10
|
Defined in src/helpers/info-logger.ts:8
|
Max entries to be shown inside the information panel |
add | ||||||||||||
add(data: string, label?: string)
|
||||||||||||
Defined in src/helpers/info-logger.ts:15
|
||||||||||||
Add an entry to the info logger
Parameters :
Returns :
void
|
getInfoLoggerList |
getInfoLoggerList()
|
Defined in src/helpers/info-logger.ts:26
|
Get the info logger list being used by the info logger service
Returns :
any[]
The info logger list containing log data |
export class InfoLogger {
/** List that contains all the info logs */
private infoLoggerList: any[] = [];
/** Max entries to be shown inside the information panel */
private maxEntries: number = 10;
/**
* Add an entry to the info logger
* @param data Data of the info log
* @param label Label of the info log
*/
add(data: string, label?: string) {
if (this.infoLoggerList.length > this.maxEntries) {
this.infoLoggerList.pop();
}
this.infoLoggerList.unshift(label ? label + ': ' + data : data);
}
/**
* Get the info logger list being used by the info logger service
* @returns The info logger list containing log data
*/
getInfoLoggerList(): any[] {
return this.infoLoggerList;
}
}