Hacker News new | ask | show | jobs
by vosper 5093 days ago
I don't know how many new logging statements you commit to production code every day, but I can't imagine it averages out to more than one or two. If you can't take the time to phrase them both professionally and meaningfully then you're doing yourself and your team a disservice.
3 comments

Moreover, you have, in your head, the log message that should be written.

At the time of writing the code, you're hopefully thinking through "how could this fail?"

There's your log message.

I dunno. Sometimes there's just a scenario that isn't really easy to fit into a meaningful phrase, and that shouldn't happen too often.

"FUUUCK" is awfully good at conveying the seriousness of the error, and "aslfkhsdf37" ensures that the string is unique, so you can pinpoint it instantly in your gigantic codebase.

The fact is, it kind of works. Something like "missing record (line 38)" doesn't indicate the severity, there might be 10 different "missing record" error strings in your codebase, and somehow in real life, line numbers and filenames never seem to quite match up like they should (transcompilation, async callbacks, and so on.)

I think Dropbox did well enough financially and technically, so that the team doesnt need pedantic advice on professionalism...