I question the thesis that "writing" code productively is the only part of DX. When I consider DX, I consider that code is written less often than it is amended, than it is read, and than it is run.
Getting all of those things right is DX, not just writing.
Easy example is clear errors and logging making it easier to run, debug and amend software. That's part of the DX, but not necessarily part of the DX of writing the software for the first time.
I'm still not sure whether I understand. Logging is not something that appears out of nowhere, it's usually the developers' task to write logs. I haven't seen a framework that does logging for you (except for internal components).
Do you maybe mean how easy it is to integrate existing logging frameworks into your application?
Getting all of those things right is DX, not just writing.