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

[Plugins] The behavior of python and cpp plugins output is not identical #178

Closed
frank-zsy opened this issue Mar 23, 2023 · 4 comments
Closed

Comments

@frank-zsy
Copy link

Is your feature request related to a problem? Please describe.

Right now, for python plugins and cpp plugins, the output behaviors are not identical.

For Python plugins:

  • If I start the server in daemon mode, print function will output the content into .err file rather than .log file.
  • If I start the server in console, print function will not take effect and print message into the console.

For cpp plugins:

  • If I start the server in daemon mode, std::cout will not take effect, no message will be found in .err file nor .log file.
  • If I start the server in console, std::cout will print the message into the console.

The behavior is quite confusing and not very friendly for users to debug their own plugins.

Describe the solution you'd like

  • If start the server in daemon mode, Python print should write the log into .log file rather than .err file. And std::cout should write the log into .log file too and maybe std::err should write the log into .err file.
  • If start the server in console, all output functions should take effect and write the logs into the console.
@limingyao001
Copy link
Contributor

Thanks for the tip, we'll fix it as soon as possible

@knightast
Copy link
Contributor

Thanks!

In our roadmap,the log system will be rewritten and competed in 2023.7.

@qishipengqsp
Copy link
Collaborator

Hi, the log system has been rewritten. Now there is no .err file, only .log file.

  • If you set the item log_dir in config file to NULL, the log will be redirected to the console. (If the server is running in daemon mode, there is no log recorded.)
  • If you set it to a specific path, the log will be written to the file path.

This applies to the log prints code both in cpp plugin and the python plugin. The only difference here is that the print in python plugin writes log in warning level.

@qishipengqsp
Copy link
Collaborator

The issue is closed due to inactivity. Please feel free to create a new one if you have more questions. And please star this repo if you find it useful! Thanks!
此issue由于长期不活跃被关闭。如有任何问题,可另开 issue 并提供更多信息。如果这个项目帮助到你,可以在仓库右上角 star 一下,感谢你的支持!

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

4 participants