mrousavy / vision-camera-image-labeler

VisionCamera Frame Processor Plugin to label images using MLKit Vision

Home Page:https://github.com/mrousavy/react-native-vision-camera

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

doubts: where does this come from, and where should this log appear?

rodgomesc opened this issue · comments

_log(`Labels: ${labels.join(', ')}`);

declare + comment in VisionCamera :

/**
 * A native logging function (outputs to Xcode console/Android Logcat)
 */
declare var _log: (message: string) => void | undefined;

implementation from Reanimated:

  auto callback = [](
                     jsi::Runtime &rt,
                     const jsi::Value &thisValue,
                     const jsi::Value *args,
                     size_t count
                     ) -> jsi::Value {
    const jsi::Value *value = &args[0];
    if (value->isString()) {
      Logger::log(value->getString(rt).utf8(rt).c_str());
    } else if (value->isNumber()) {
      Logger::log(value->getNumber());
    } else if (value->isUndefined()) {
      Logger::log("undefined");
    } else {
      Logger::log("unsupported value type");
    }
    return jsi::Value::undefined();
  };
  jsi::Value log = jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "_log"), 1, callback);
  rt.global().setProperty(rt, "_log", log);

This is outdated since VisionCamera supports console.log since mrousavy/react-native-vision-camera#297.

thanks, for the quick feedback