3 ms·
Print debugging requires zero configuration. So, for "easy" debugging sessions, I will use print debugging (it does work using plain Vim!). For more serious de
by sdevonoes 5y ago
Print debugging requires zero configuration. So, for "easy" debugging sessions, I will use print debugging (it does work using plain Vim!).
For more serious debugging, sure, a proper debugger is the way to go.
- commandlinefan 5y agoIf you're in an IDE, though, you can use logpoints rather than breakpoints and have the best of both worlds - "print" debugging without the need to recompile to test (and without having to remember to delete the print statement when you're finished with it).
- simiones 5y agoEven if you're in an IDE, the debugger will often require configuration if the app is not running directly on your local setup. This can range from rather trivial (run app in debug mode, connect to debug port) to rather complex (change the docker image for your app to include a debugger service of some kind).
- commandlinefan 5y agoOk, but isn't that true of print debugging too? Wherever the application is running, you have to recompile and redeploy it.
- simiones 5y agoSure, but I'm talking about more than that. For example, my Go microservices run in containers built like this: FROM scratch COPY --from=build-container /go/bin/the-binary /go/bin/the-binary So, the final container only contains my Go binary and nothing else. If I add some debug logging, I just rebuild my binary, rebuild the container, and re-deploy. However, if I want to debug this, I need to use a different container that includes Go delve (the Go debugger) and any dependencies it relies on, possibly open some extra ports, deploy that container instead of the standard one etc.