- the very concept of logs is to dump a load of (debug) info for later analysis,
so making some distinction between debug and non-debug info while logs are
_inherently_ for debugging seems a little silly to me
% id = "01HBTSXTTADJCTV9RTWT4NPASS"
+ use severities instead of verbosities
% id = "01HBTSXTTA3KN26DS4QMPSHEEC"
- `error` is "OH SHIT OH FUCK UHHH"
% id = "01HBTSXTTATK9W0TRGM50SKWRE"
- `warn` is "ding ding ding! something ain't right, but I'll carry on"
% id = "01HBTSXTTA8Z5JJHFKH4T88G0B"
- `info` is just that - info
% id = "01HBTSXTTANQXBN7FQQSBXTSB1"
- and there is really no need for anything lower, because guess what: [`debug` and `trace`](https://docs.rs/tracing/latest/tracing/struct.Level.html)
and [`Display` and `Verbose` and `VeryVerbose`](https://docs.unrealengine.com/4.26/en-US/API/Runtime/Core/Logging/ELogVerbosity__Type/)
and what have you - they're all just more `info` for you
% id = "01HBTSXTTAE94HEE60GZFBEAW7"
- and while writing logging code it's always hard to decide which info should be
stuffed into which verbosity, because which info will be interesting to you at the
time you read logs depends on what you're looking for at a given moment
% id = "01HBTSXTTAKZ3MKD3EJPX84J9N"
+ this is something I haven't tried yet, but one day I wanna build a logging framework one day that associates severities with whole categories rather than individual log messages
% id = "01HBTSXTTAD4TQ0A8JP71KZMXA"
- but at that point, do we even need severities at all? would a hierarchy of categories suffice?
% id = "01HBTSXTTAW160GH44JV3JYV3Y"
- I have no clue how well that will work but it would be pretty interesting
- any time I see a NaN I cry inside knowing how much pain debugging it's gonna be.
% id = "01HPEMVAH9Y3W35Y6Z4QMCJ5QM"
- I'd rather have the program crash and burn at the point a `NaN` is produced rather than have to sift through all the math to find that one division by zero I didn't account for
- this does influence performance negatively, but it saves _so much_ debugging pain and finding out which non deterministic scenario causes a NaN to propagate through the system
- worst case scenario you pull a Rust and disable those checks on release mode. that _does_ work, but I don't like the idea of disabling numeric safety checks on release mode either.
- I'll start by prefacing that I think operator overloading is good [_iff_][def:word/iff] it's implemented in a way that a single operator has only one, well-defined meaning
- this is practically impossible to enforce at a language level - what prevents the standard library authors from overloading `+` to mean string concatenation after all?
% id = "01HPEQ01JRY7R5QGJ2AM762PPN"
- however we can at least do our best by writing good defaults and coding standards that gently suggest what to do and what not to do
- for example, allow users to define their own arbitrary operators that are explicitly _not_ addition, to incentivize inventing new syntax for these things
- `(+)` is defined to be a polymorphic operator which calls into a module implementing the `AddSub` interface, which means you have to implement both addition _and_ subtraction for `(+)` to work on your type
+ the `(add AND subtract)` rule enforces types like strings to take a different operator, because `(-)` does not have a well-defined meaning on strings
% id = "01HPEQ01JRGCPT2PGY5HK7HK7F"
- is `"foobar" - "bar" == "foo"`?
% id = "01HPEQ01JR3CVNNACZ6EGQ7NWM"
- by extension, is `"foofoobarbar" - "bar" == "foofoobar"` or `"foofoobarbar" - "bar" == "foofoo"`?
% id = "01HPEQ01JRK25NHG72ZX5XHEEJ"
- maybe characters are subtracted from the left string one by one? such that `"foobar" - "bar" == "\x04\x0e\xfcbar"` (wtf)
% id = "01HPEQ01JR25J5BY54J6RJ0KEC"
- so now getters and setters: what's so bad about them?
- the problem is that given the rule above - _one operator means one thing_ - getters and setters completely destroy your assumptions about what `=` might do