sdcb / PaddleSharp

.NET/C# binding for Baidu paddle inference library and PaddleOCR
Apache License 2.0
1.07k stars 200 forks source link

[Question] Use a custom logging provider for PaddleInference #83

Open aboccag opened 9 months ago

aboccag commented 9 months ago

Hello,

First, thank you for your library and your great work!

I am using PaddleSharp in my project and I have activated the loggs with the boolean GLogEnabled It looks like it redirect the logs from PaddleInferenceC to the Console.Writeline / Standard output somehow. In my project I am using Serilog for logging. Is there any way to write an adapter for Serilog ?

Many thanks!

n0099 commented 9 months ago

As you guessed it's a C native method from PaddleInferernce to enable its logging towards stdout of the process, so no changes like logging to elsewhere can be made in .NET managed side. It's still possible to filter logging from PaddleInferernce out of stdout by preventing any other echoing to stdout like Serilog, then redirect the stdout to somewhere like a file with >.

aboccag commented 9 months ago

Alright thank you

sdcb commented 7 months ago

Tracked by this: https://github.com/PaddlePaddle/Paddle/issues/62367