oxen-io / lokinet

Lokinet is an anonymous, decentralized and IP based overlay network for the internet.
https://lokinet.org/
GNU General Public License v3.0
1.76k stars 220 forks source link

Logging overhaul, fmt::format, and related #1955

Closed jagerman closed 2 years ago

jagerman commented 2 years ago

This replaces custom logging system with spdlog-based oxen logging. This PR mainly replaces the backend logging with the spdlog-based system, but doesn't (yet) convert all the existing LogWarn, etc. to use the new format-based logging.

New logging statements will look like:

llarp::log::warning(cat, "blah: {}", val);

where cat should be set up in each .cpp or cluster of .cpp files, as described in the oxen-logging README

As part of spdlog we get fmt, which gives us nice format strings, where are applied generously in this PR.

Making types printable now requires two steps:

This will then allow the type to be printed as a "{}" value in a fmt::format string. This is applied to all our printable types here, and all of the operator<< are removed.

This commit also:

jagerman commented 2 years ago

Still todo: