HackerTrans
TopNewTrendsCommentsPastAskShowJobs

pR0Ps

no profile record

comments

pR0Ps
·geçen yıl·discuss
Same: https://github.com/ianare/exif-py/pull/75/files

I feel like a bit of a fraud because this was the PR that got me the "Mars 2020 Contributor" badge...
pR0Ps
·2 yıl önce·discuss
Yet another fzf-based implementation: https://github.com/pR0Ps/dotfiles/blob/master/bin/ijq

(Demo: https://asciinema.org/a/349330 )
pR0Ps
·3 yıl önce·discuss
https://cmetcalfe.ca/blog

Contains mostly guides on random things I learn over time and other bits of information I think should be publicly available.

Not very frequently updated, but RSS is available so it can be chucked in an RSS reader and forgotten about.
pR0Ps
·4 yıl önce·discuss
This has been an issue forever (I have a similar blog post from 4+ years ago tracking down the exact same issue: https://cmetcalfe.ca/blog/diagnosing-periodic-high-ping-time... ) and I can't believe it's still not fixed.
pR0Ps
·4 yıl önce·discuss
You can actually do this with any level of log message by passing `exc_info=True` to it. This is super useful in cases where you want to log the exception context, but don't need to be at a high logging level.

Ex:

    logger.debug("A non-critical exception occurred", exc_info=True)
pR0Ps
·4 yıl önce·discuss
Maybe it's Stockholm syndrome, but contrary to what seems like most people I don't actually mind the built in logging library. Sure, it reeks of its Java roots and can be a bit of a pain to set up configure, but once that's done it's incredibly flexible and generally works really well.

One of the main gripes I do have with it is its reliance on the old-school %-based formatting for log messages:

    logger.debug("Invalid object '%s'", obj)
As there are real advantages to providing a template and object args separately, this is a bit of a shame since it pushes people to use pre-formatted strings without any args instead.

I fixed this for myself by writing bracelogger[0]. If this is a pain point for you too, you might find it useful.

Ex:

    logger.debug("Invalid object of type {0.__class__.__name__}: {0}", obj)
[0]: https://github.com/pR0Ps/bracelogger