Is there a way to find out, if we are currently in a webinterface request?
My usecase is the following:
I want to implement a logger, which in addition to the actual log message also logs information about the the request which is currently being handled (if any). For this I would like to call request()
, which gives me the current HTTPServerRequest
. However, this results in an AssertError
, whenever logging appears outside of a webinterface request (so basically immediately after starting the application, because vibe.d logs some things automatically). So I would need to check, if we are currently processing a webinterface request.