if do not use the config file, how to stop the log file, emalog, by coding?

if do not use the config file, how to stop the log file, emalog, by coding?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @kage.wu

    You can programmatically create configurations. For example, please refer to the 421__MarketPrice__ProgrammaticConfig example.

    To disable EMA log file, you need to set LoggerType to 1 (LoggerType::StdoutEnum) and LoggerSeverity to 4 (Severity::NoLogMsgEnum).

        innerMap.addKeyAscii( "Logger_1", MapEntry::AddEnum,
            ElementList()
            .addEnum( "LoggerType", 1 )
            .addAscii( "FileName", "logFile" )
            .addEnum( "LoggerSeverity", 4 ).complete() ).complete();

    However, the configurations can't be changed after they are used to create an OMMConsumer.

    OmmConsumer consumer( OmmConsumerConfig().config( configMap ) );    

Answers