@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 ) );
Hi @kage.wu,
The recommended way to do this is by using an EMA Configuration file. Please see this question for more details.
I don't believe there is a way to do this entirely within code. Please refer to a similar question you asked on another thread. .
thanks.
I haven't used any config in my app, but I still have log files as emaLog_*. How can I put into my source codes to stop the log files?
Please see my answer below. I'm recommending to use a config file only to to disable these log files. The answer also states that you can't put it into your source code.
that's ridiculous. so how to use the config file in the coding? can you provide to me? it will save me time