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

Logs are written into stdout #65

Open
zevlg opened this issue Jan 10, 2019 · 3 comments
Open

Logs are written into stdout #65

zevlg opened this issue Jan 10, 2019 · 3 comments

Comments

@zevlg
Copy link
Contributor

zevlg commented Jan 10, 2019

I've noticed that under linux logs are written into stdout. If some program links to libtgvoip and uses stdout for its own purpose, there is no way to separate ordinary output from the program and logging output made by libtgvoip.

Is not it a good practice for libraries to write logs/diagnostics to stderr instead of stdout ?

@grishka
Copy link
Owner

grishka commented Jan 10, 2019

I'm really not sure about this one as I've seen libraries writing logs to stdout. There is a define to control this (TGVOIP_LOG_VERBOSITY=0..5) where 5 is most verbose and 0 is no logging. You're probably right that there needs to be a way to control stdout/logcat/NSLog logging separately from file logging (to a file you optionally specify in config) or even to specify a custom logging function.

@zevlg
Copy link
Contributor Author

zevlg commented Jan 11, 2019

Yeah, I’m currently disabled logging via TGVOIP_LOG_VERBOSITY, but having active logs from tgvoip is very helpful. Custom log func sounds great! Or at least having some custom FILE* to write logs to

@zevlg
Copy link
Contributor Author

zevlg commented Jan 14, 2019

I like tdlib's approach for logging: it writes logs into specified file and rotates it after exceeding specified size. It also has logging level customizable at runtime

zevlg added a commit to zevlg/libtgvoip that referenced this issue Jan 21, 2019
- grishka#65
- grishka#68

to work with telega-server
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