k2-fsa/sherpa-ncnn

How to print ncnn log in ios?

Closed this issue · 7 comments

I have tried to print the ncnn log in ios. But the log hasn't been printed out.

Please post the code.

Please post the code.
The code is inside the ncnn source code ncnn-src/src/layer.cpp.

#if NCNN_STRING
int layer_to_index(const char* type)
{
    for (int i = 0; i < layer_registry_entry_count; i++)
    {
        NCNN_LOGE("Layer_to_index %s %d", type, i);
        if (strcmp(type, layer_registry[i].name) == 0)
            return i;
    }

    return -1;
}

I want to print the ncnn log above on the iOS terminal, but it appears that it can only be printed in the CLION terminal window and not the iOS Xcode terminal window.

You'll need to re-compile the code after you modify it.

Remember to use the correct script
https://github.com/k2-fsa/sherpa-ncnn/blob/master/build-ios.sh
to compile the code.

Also, remember to use the re-compiled libraries in your project to replace your previous libraries.

You'll need to re-compile the code after you modify it.

Remember to use the correct script https://github.com/k2-fsa/sherpa-ncnn/blob/master/build-ios.sh to compile the code.

Also, remember to use the re-compiled libraries in your project to replace your previous libraries.

Yes. What I did is to modify the ncnn source code inside build-ios/build/os64/_deps/ncnn-src/src/layer.cpp

Did you rebuild the project after the change?

If yes, are you using the latest xcframework after re-building?

Have you fixed it?

Yes. Thank you!