7

To fix a bug I added a few log messages to trace what gets executed and in what order (very new to the project). Fixed the bug, pushed PR and the only comment was to remove the log files. 🤦‍♂️🤦‍♂️

Please tell me this is normal or should I start looking for a new place that hires "only the best" 😭

Comments
  • 5
    lol In the last Century, I used to put printf() statements in my C code to debug. Yeah, fixed the bugs and deployed to prod... with the print statements still in the code.

    >>>top of function x<<<
  • 2
    @iAmNaN Sure, that might not be the ultimate desired outcome 😄

    But all our logs get stripped out during the prod build (par of CD/CI)
    So nothing gets logged in prod and if there's more work I need to add them back in... sounds like lose/lose situation 😔
  • 1
    I wonder if using a debugger instead is possible here. Maybe you can have a debug branch where you can cherry pick them back from if the need rises?
  • 1
    You need to have some sort of pre-commit hook to remove them. It shouldn't show up in the tree, unless the server has its own hook specifically for that which would be pointless...
  • 1
    use a logger
  • 0
    @electrineer I was about to create a branch with logs if this thread convinces me logs should stay out of committed code base 😄 so far I'm still not convinced 🤫
  • 0
    @kleopi I was using the logger provided by SDK, all above the board and still I got shot down by a couple of my peers 🤕
  • 2
    And then there are us C/C++ folks who simply utilize the preprocessor to make debug log messages to only show up in debug builds...
    (with file name and line number)

    Honestly, I never realized before how complicated this is in other languages...
  • 1
    @Yamakuzure or even better, use a debugger
  • 0
    @electrineer as well, yes. 👍
Add Comment