kazu-yamamoto / logger

A fast logging system for Haskell
159 stars 68 forks source link

ToLogStr instances for Int and Word #175

Closed andrewthad closed 5 years ago

andrewthad commented 5 years ago

I frequently work with Int and Word values that I need to include in log messages. In almost all cases, I want these to be represented in decimal (not hexadecimal or binary). I was wondering what the maintainers' thoughts were on adding ToLogStr instances for Int and Word. The argument against it is that there's more than one way to encode an int. However, this typeclass exists more for convenience than anything else, so maybe this is alright.

chessai commented 5 years ago

Seconded. Int{,8,16,32,64} and Word{,8,16,32,64} instances using ByteString Builder would be useful.

kazu-yamamoto commented 5 years ago

PR is highly welcome. :-)

andrewthad commented 5 years ago

Pull request at https://github.com/kazu-yamamoto/logger/pull/177