Console
Flexi Console is the console output panel of the Flexi Editor, including features such as Log output, code debugging, and Log viewing.
Opening the Console
Click Help (Menu Bar) -> Open Console in the Editor. The Console will appear at the bottom of the Editor by default.
Getting to Know the Console
No. | Description |
---|---|
1 | Search Box |
2 | Page Refresh Pause/Resume |
3 | Log Category Filter |
4 | Log File Switch |
5 | Log Output Viewing Platform |
Searching Logs
The Log Output Viewing Platform will present the filtered Log output content after entering keywords in the Search Box. Click the button to clear the Search Box.
Filtering Logs
Click the Filter button to expand the two filtering categories divided into Level and Module. All options are checked by default.
- Log Level: Used to distinguish the warning levels of the Log, whether it is ERROR output or WARNING output, or other levels;
- Primary Log Module: Used to select the relevant Log module, quickly viewing the Log content of a certain category.
- Secondary Log Module: Sub-module Logs of the Primary Log Module, used to further distinguish each sub-functional module under the Primary Module.
Switching Logs
Contents of different Log files can be displayed by switching Logs, with the Log output Trace.Log of the Flexi Editor being displayed by default.
Right-click Operations
Right-click in the Log Output Viewing Platform to bring up a shortcut menu.
No. | Description |
---|---|
1 | Refresh the current Log output interface |
2 | Clear the current Log |
3 | Open the Log source file |
Outputting Logs
Editor Lua Script Output
Output function: nx_Log("<Log output content>")
-- Demo.lua
nx_Log("Hello world")
C++ Program Output
Include header file
#include "flexi/public/core_Log_ex.h"
;Declare a struct
DECLARE_Log_NAME(<Log Module Name>)
in the header file of the used class, and implement the structDEFINE_Log_NAME(<Log Module Name>)
in the implementation file of the class, to display the code hints in the Editor when using the current class.For Primary Log:
FLEXI_LOG(<Log Module Name>, <Log Level Type>, "<Log output content>")
, input the module name, log level type and output content respectively.// Demo.h
#include "flexi/public/core_log_ex.h"
DECLARE_LOG_NAME(Module)// Demo.cpp
DEFINE_LOG_NAME(Module)
void output_log()
{
FLEXI_LOG(Module, LOG_TYPE_DISPLAY, "Hello world");
}For Secondary Log:
FLEXI_LOG(<Sub Log Module Name>, <Log Level Type>, "<Log output content>")
, input the sub module name, log level type and output content respectively.// Demo.h
#include "flexi/public/core_log_ex.h"
DECLARE_LOG_SUB(Module, SubModule)// Demo.cpp
DEFINE_LOG_SUB(Module, SubModule)
void output_log()
{
FLEXI_LOG(SubModule, LOG_TYPE_DISPLAY, "Hello world");
}