User: Password:
|
|
Subscribe / Log in / New account

They should be paying attention to the lumberjack project

They should be paying attention to the lumberjack project

Posted Apr 15, 2012 0:54 UTC (Sun) by aliguori (subscriber, #30636)
In reply to: They should be paying attention to the lumberjack project by dlang
Parent article: Toward more reliable logging

I really don't have a suggestion. The closest thing I can think of is S-Expressions or YAML.

JSON is woefully under specified. There is no guidance in the spec about how implementations should handle numerics. It defers to EMCAScript for any specification ambiguity and EMCAScript is pretty clear that all numbers are represented as IEEE double precision floating point numbers.

AFAICT, a conforming implementation must truncate any number > 2^52 or at least treat two numbers as equivalent if they truncate to the same number.


(Log in to post comments)

They should be paying attention to the lumberjack project

Posted Apr 15, 2012 1:36 UTC (Sun) by dlang (subscriber, #313) [Link]

what is the numeric range in YAML?

2^52 is a rather large number, how likely are you to need larger numbers in log messages? Are those cases distinct enough that you could just use the 'string' type for the number?

S-Expressions seem even more under specified than JSON from what I see from a quick google search

They should be paying attention to the lumberjack project

Posted Apr 15, 2012 2:10 UTC (Sun) by Cyberax (✭ supporter ✭, #52523) [Link]

2^64-1 is quite likely to appear at least in some log entries.

They should be paying attention to the lumberjack project

Posted Apr 15, 2012 3:02 UTC (Sun) by dskoll (subscriber, #1630) [Link]

According to the JSON specification, the following is a perfectly valid number:

18446744073709551615 (AKA 264-1)

It may be that some (most?) JSON libraries can't handle such a large number correctly, but it's valid according to the JSON grammar.

They should be paying attention to the lumberjack project

Posted Apr 27, 2012 15:45 UTC (Fri) by mirabilos (subscriber, #84359) [Link]

Only floats. Integers are not limited.


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds