Basically, you have to write a method in mm
file to use these C++ functions.
#include <ReactNativeBridgeInstrument/CxxNativeModulePerfLogger.h>
// make sure `CXXFLAGS += -std=c++14` or 14 above in your Xcode building settings
#include <memory>
- (void)initializeInstrument
{
facebook::react::CxxNativeModulePerfLogger logger = facebook::react::CxxNativeModulePerfLogger();
facebook::react::BridgeNativeModulePerfLogger::enableLogging(std::make_unique<facebook::react::CxxNativeModulePerfLogger>(logger));
}
-
Open the instrument, choose
Blank
template in Instrument -
Then , add
os_signpost
to current template, and start recording. -
pay attention to our customed logger Volume. There are 4 parts,