Thanks for confirming that Jan. 
That's very helpful.

ב-יום חמישי, 6 בינואר 2022 בשעה 14:38:45 UTC+2, Jan Tattermusch כתב/ה:

> Sorry, no, it's not possible. The initialization of the native C-core 
> library is non-trivial and changing the debugging level in the native code 
> at runtime is not something we implemented.
> If you want, you can provide a custom logger in the managed C# layer (
> https://github.com/grpc/grpc/blob/master/src/csharp/Grpc.Core/Logging/ILogger.cs)
>  
> and avoid printing messages at a given verbosity level at runtime, but 
> C-core would still generate those debug messages (which means overhead), 
> you can just prevent them from being printed (not sure if that's helpful in 
> your case).
>
> On Monday, December 13, 2021 at 4:12:37 PM UTC+1 [email protected] wrote:
>
>> Trying one more time... Can anyone reply on this one?
>>
>> ב-יום רביעי, 8 בדצמבר 2021 בשעה 12:29:56 UTC+2, ‪Tomer Schwartz‬‏ כתב/ה:
>>
>>> I posted this question also on SO, but no replies there as well. I'm 
>>> actually surprised, as this question should be trivial, no? (either it's 
>>> supported or not...)
>>> Anyway, here is the call-stack on the server side that triggers the 
>>> modification of the verbosity level and actually checks the value of the 
>>> environment variable:
>>> [image: Picture1.png]
>>>
>>> So this happens following the construction of GrpcEnvironment, but this 
>>> is a singleton and its ctor is not accessible.
>>> In addition, the method gpr_log_verbosity_init() wasn't declared as 
>>> external and can't be used from managed code.
>>> Any feedback would be appreciated.
>>>
>>> Thanks,
>>> Tomer.
>>> ב-יום שלישי, 7 בדצמבר 2021 בשעה 10:38:08 UTC+2, ‪Tomer Schwartz‬‏ כתב/ה:
>>>
>>>> Hi, 
>>>>
>>>> Is it possible to change the verbosity level of the native gRPC C core 
>>>> libraries *during runtime*? 
>>>> Setting the GRPC_VERBOSITY and GRPC_TRACE as described here 
>>>> <https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md>, seems 
>>>> to work only if it's done before initialization stages of gRPC C Core. 
>>>> To be more specific, we are using Grpc.Core 
>>>> <https://www.nuget.org/packages/Grpc.Core/> library which is the C# 
>>>> implementation of gRPC based on the native gRPC C-core library. When 
>>>> looking at the C-Core library, I see that in log.cc there is a static 
>>>> member called g_min_severity_to_print, which determines whether 
>>>> gpr_should_log or not, but that member is being set only during 
>>>> gpr_log_verbosity_init(), and that function is called only during 
>>>> initialization (grpc_init() --> grpc_once_init() --> ... --> 
>>>> do_basic_init() --> gpr_log_verbosity_init()).
>>>>
>>>> Thanks,
>>>> Tomer.
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/4ea9ea2f-0b82-4f6b-b3a6-d7fee9826ea2n%40googlegroups.com.

Reply via email to