Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: error messages and switching off logging #356

Closed
farindk opened this issue May 26, 2023 · 5 comments
Closed

Request: error messages and switching off logging #356

farindk opened this issue May 26, 2023 · 5 comments

Comments

@farindk
Copy link
Contributor

farindk commented May 26, 2023

I have just added a kvazaar encoder plugin to libheif as an alternative HEIC encoder:
strukturag/libheif@2fb1063

I came across two things that I could not find:

  • When an API function returns an error, is there any error message or further information that I could pass on?
  • Could you add a config parameter to switch off the logging to stdout through the API?
@Jovasa
Copy link
Member

Jovasa commented May 31, 2023

When an API function returns an error, is there any error message or further information that I could pass on?

No, not really. Since error handling in general is not easy in C, we do the bare minimum.

Could you add a config parameter to switch off the logging to stdout through the API?

Kvazaar shouldn't output anything to stdout (except help or version message), so I assume you mean stderr? Even then do you mean error messages from the config parsing, since the actual logging by the encoder is performed by the CLI and not the API version of Kvazaar that you are using. Nevertheless, there is no such option, but if you want to create it yourself we would be happy to accept a pull request for such feature.

@farindk
Copy link
Contributor Author

farindk commented May 31, 2023

The following is printed to stderr in api->encoder_open():

Compiled: INTEL, flags: MMX SSE SSE2
Detected: INTEL, flags: MMX SSE SSE2 SSE3 SSSE3 SSE41 SSE42 AVX AVX2
Available: avx(11) avx2(54) sse2(2) sse41(4) 
In use: avx(1) avx2(54) 
--owf=auto value set to 2.
--threads=auto value set to 8.

@farindk
Copy link
Contributor Author

farindk commented May 31, 2023

Printing is done here:

fprintf(stderr, "Compiled: INTEL, flags:");
#if COMPILE_INTEL_MMX
fprintf(stderr, " MMX");
#endif
#if COMPILE_INTEL_SSE
fprintf(stderr, " SSE");
#endif
#if COMPILE_INTEL_SSE2
fprintf(stderr, " SSE2");
#endif
#if COMPILE_INTEL_SSE3
fprintf(stderr, " SSE3");
#endif
#if COMPILE_INTEL_SSSE3
fprintf(stderr, " SSSE3");
#endif
#if COMPILE_INTEL_SSE41
fprintf(stderr, " SSE41");
#endif
#if COMPILE_INTEL_SSE42
fprintf(stderr, " SSE42");
#endif
#if COMPILE_INTEL_AVX
fprintf(stderr, " AVX");
#endif
#if COMPILE_INTEL_AVX2
fprintf(stderr, " AVX2");
#endif
fprintf(stderr, "\nDetected: INTEL, flags:");
if (kvz_g_hardware_flags.intel_flags.mmx) fprintf(stderr, " MMX");
if (kvz_g_hardware_flags.intel_flags.sse) fprintf(stderr, " SSE");
if (kvz_g_hardware_flags.intel_flags.sse2) fprintf(stderr, " SSE2");
if (kvz_g_hardware_flags.intel_flags.sse3) fprintf(stderr, " SSE3");
if (kvz_g_hardware_flags.intel_flags.ssse3) fprintf(stderr, " SSSE3");
if (kvz_g_hardware_flags.intel_flags.sse41) fprintf(stderr, " SSE41");
if (kvz_g_hardware_flags.intel_flags.sse42) fprintf(stderr, " SSE42");
if (kvz_g_hardware_flags.intel_flags.avx) fprintf(stderr, " AVX");
if (kvz_g_hardware_flags.intel_flags.avx2) fprintf(stderr, " AVX2");
fprintf(stderr, "\n");
#endif //COMPILE_INTEL
#if COMPILE_POWERPC
if (cpuid) {
kvz_g_hardware_flags.powerpc_flags.altivec = altivec_available();
}
fprintf(stderr, "Compiled: PowerPC, flags:");
#if COMPILE_POWERPC_ALTIVEC
fprintf(stderr, " AltiVec");
#endif
fprintf(stderr, "\nDetected: PowerPC, flags:");
if (kvz_g_hardware_flags.powerpc_flags.altivec) fprintf(stderr, " AltiVec");
fprintf(stderr, "\n");
#endif

@Jovasa
Copy link
Member

Jovasa commented May 31, 2023

Sorry, yes you are correct, this was already brought up in #292 and then answer is pretty much the same still.

@farindk
Copy link
Contributor Author

farindk commented May 31, 2023

And all over in this function:

encoder_control_t* kvz_encoder_control_init(const kvz_config *const cfg)

farindk added a commit to farindk/kvazaar that referenced this issue May 31, 2023
Jovasa added a commit that referenced this issue Jun 2, 2023
add config option to turn off logging output (#356)
@Jovasa Jovasa closed this as completed Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants