Replies: 5 comments
-
"typically"... where? :-) I've seen error logs go to stderr, but regular log messages often go to stdout. It would, however, be nice to have the choice. |
Beta Was this translation helpful? Give feedback.
-
For instance
writes html to stdout and logs to stderr. Topic also discussed here: https://stackoverflow.com/a/4919110 |
Beta Was this translation helpful? Give feedback.
-
But I agree, example above is not enough to say "typically". Anyways, having a choice would be nice. |
Beta Was this translation helpful? Give feedback.
-
Logging module in Python also seems to select stderr by default: https://github.com/python/cpython/blob/3.11/Lib/logging/__init__.py#L1084 If only errors should go to stderr, selection of the stream would need to be dependent of the logging level. Personally, I think that this would overcomplicate though. |
Beta Was this translation helpful? Give feedback.
-
The current |
Beta Was this translation helpful? Give feedback.
-
Describe the feature
By convention application logs typically should go to stderr. Make it possible with vlib/log.
Use Case
I would like users to easily distinguish between computation results from my app (which go to stdout) and the logs.
Proposed Solution
I would recommend to:
set_output_stream
method that allows to select between stdout and stderr.Other Information
No response
Acknowledgements
Version used
V 0.3.2 865c0e
Environment details (OS name and version, etc.)
OS: macos, macOS, 12.6.1, 21G217
Processor: 10 cpus, 64bit, little endian, Apple M1 Pro
CC version: Apple clang version 14.0.0 (clang-1400.0.29.202)
Beta Was this translation helpful? Give feedback.
All reactions