smol
                                
                                 smol copied to clipboard
                                
                                    smol copied to clipboard
                            
                            
                            
                        Logging
We should have some traces in the reactor or executor
It would be really cool if the executor timed futures and logged a warning when they take an unusually long time.
I want to add some logging to both reactor and executor but need concrete suggestions:
- What in particular would you like to see logged?
- What logging format should be used? How do we display a text message and then some additional info?
What logging format should be used?
Wouldn't logging output and formatting be handled by the application through something like tracing_subscriber or log? That would probably be preferred over having smol log directly. There are too many different format's and places you might want to log to ( syslog, stdout/stderror, etc. ).
How do we display a text message and then some additional info?
The tracing crate allows you to specify a message and extra fields, but again, I think the display should probably be left up to the user.
What in particular would you like to see logged?
I'm not completely sure, especially because I don't know what smol does under the hood that I might need to know about. :)
It would be great to have warnings for common mistakes or other things that might seem amiss if there are ways to misuse smol or other things that smol might be able to notice like detecting when to turn up the thread count or something ( I don't know just throwing it out there ).
If I were a smol developer I might want some trace logs that print out low-level events that could be useful for debugging.
+1 for trace. Example usage in the h2 project: https://github.com/hyperium/h2/blob/d3b9f1e36aadc1a7a6804e2f8e86d3fe4a244b4f/src/proto/connection.rs.
rustc is using tracing these days, and as a result, tracing has gone through many optimizations. It seems like a good default.
I'd like to use tracing, but it's currently blocked until we bump our MSRV. See #244.