Skip to main content

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.

image-20221116092534816

Getting to Know the Console

image-20221122130846835

No.Description
1Search Box
2Page Refresh Pause/Resume
3Log Category Filter
4Log File Switch
5Log 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 image-20221116101802751 button to clear the Search Box.

image-20221116101538512

Filtering Logs

Click the Filter button to expand the two filtering categories divided into Level and Module. All options are checked by default.

  1. Log Level: Used to distinguish the warning levels of the Log, whether it is ERROR output or WARNING output, or other levels;
  2. Primary Log Module: Used to select the relevant Log module, quickly viewing the Log content of a certain category.
  3. Secondary Log Module: Sub-module Logs of the Primary Log Module, used to further distinguish each sub-functional module under the Primary Module.

image-20221209110009717

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.

image-20221116162017914

Right-click Operations

Right-click in the Log Output Viewing Platform to bring up a shortcut menu.

image-20221116153632311

No.Description
1Refresh the current Log output interface
2Clear the current Log
3Open 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

  1. Include header file #include "flexi/public/core_Log_ex.h" ;

  2. Declare a struct DECLARE_Log_NAME(<Log Module Name>) in the header file of the used class, and implement the struct DEFINE_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.

  3. 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");
    }
  4. 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");
    }