Logging
Trace Log
Trace Logging is a feature in Plateau Studio that allows you to monitor and record information about the execution of your Quick applications.
It provides you with a powerful tool for tracking the flow of their code, debugging issues, and gaining insights into the application's behavior.
The method for implementing Trace Logging anything in the console in Plateau Studio is the EM.trace method.
Logs are written with green background color and white text in web browser. These logs are also added to client side.
quick.EM.trace(traceMessage: any)
quick.EM.trace('Trace Message: Success')
Client Side Log Handling
The system described below can be used to use the logs (EM.trace) written on the front page (qjson) and the logs printed on the engine (such as sending to service, keeping in the store etc.).
In order to access these printed logs, you need to write a custom event called logHandler on the PageComponent in the pipeline.json file. A parameter is sent to this event after each log is printed, depending on the interface below.
interface IMessage {
message: string // Log message
type: string // Debug | MobilDebug | Trace | Warning | Error
time: string // When the browser writes the message
caller?: string // Caller function of the message
}
Filter Trace Logs
Log types can be filtered and printed according to the user's request. The following line to be written in the relevant event will provide to filter and printed according to the user’s request.
//This line provide users to get Error logs
quick.EM.trace("",{logType:Logtype.Error})
//This line provide users to get Trace logs
quick.EM.trace("",{logType:Logtype.Trace})
//This line provide users to get Warning logs
quick.EM.trace("",{logType:Logtype.Warning})
There is a variable in the Settings File under the UI Settings on Plateau Studio called yamlLogType. This variable able to take one of the five logtype which are Debug | MobilDebug | Trace | Warning | Error. You can select one of them but this is not mandatory. Default log type is Trace.
Log types have their own priority order. When you use the method above, it calls the selected log and the following logs. The priority order is below.
export enum LogType {
Debug = 0,
MobilDebug = 1000,
Trace = 200000, //100Kb
Warning = 500000, //250Kb
Error = 1000000 // 500Kb
}
Filter Engine Logs
While page logs can be filtered with above yamlLogType usage, engine logs also can be filtered by using minEngineLogLevel.
With this feature, logs from Quick engine itself can be filtered if the log has equal or below value than the given minEngineLogLevel, it can be set in Settings File.