Commit Graph

26 Commits (dev)

Author SHA1 Message Date
Jason Rhinelander b81f7025c9
Replace logging with oxen-logger
Replaces custom logging system with spdlog-based oxen logging.  This
commit 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 commit.

Making types printable now requires two steps:
- add a ToString() method
- add this specialization:

      template <>
      constexpr inline bool llarp::IsToStringFormattable<llarp::Whatever> = true;

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:
- replaces various uses of `operator<<` to ToString()
- replaces various uses of std::stringstream with either fmt::format or
  plain std::string
- Rename some to_string and toString() methods to ToString() for
  consistency (and to work with fmt)
- Replace `stringify(...)` and `make_exception` usage with fmt::format
  (and remove stringify/make_exception from util/str.hpp).
2 years ago
Thomas Winget 7caa87862e standardize include format and pragma once
All #ifndef guards on headers have been removed, I think,
in favor of #pragma once

Headers are now included as `#include "filename"` if the included file
resides in the same directory as the file including it, or any
subdirectory therein.  Otherwise they are included as
`#include <project/top/dir/relative/path/filename>`

The above does not include system/os headers.
3 years ago
Stephen Shelton 273270916e
The Great Wall of Blame
This commit reflects changes to clang-format rules. Unfortunately,
these rule changes create a massive change to the codebase, which
causes an apparent rewrite of git history.

Git blame's --ignore-rev flag can be used to ignore this commit when
attempting to `git blame` some code.
4 years ago
Jeff Becker c010bf05a6
use correct format string 5 years ago
Jeff Becker f56e543d75
add deadlock checker and revert bencode change from long ago 5 years ago
Stephen Shelton 66a058a2af Make format 5 years ago
Stephen Shelton 1666498405 Replace bencode_write_version_entry with a more general-purpose function for writing bencoded dictionary entries 5 years ago
Jeff Becker bdb0b847f8
seek for version and set it before deserializing 5 years ago
Michael 1aec0dfa2b
Move logging to subdirectory 5 years ago
Michael 16cdfbd5f0
clang-tidy modernize pass 5 years ago
Michael 7ca0927d8f
Replace dict_reader/list_reader with version which doesn't involve indirection 5 years ago
Jeff 5834607997 * don't ban bootstrap nodes with profiling
* less vigorous profiling timeouts
* async remove rc from disk
5 years ago
Rick V d887004d99
fix warning 5 years ago
Jeff Becker bfcaaa87be
check for empty buffer 5 years ago
Rick V e94d1ebb4f
combine these 5 years ago
Michael 4fb2b39f74
Format changes 5 years ago
Michael c6e6bdb90f
Fix for windows just being the Worst 5 years ago
Michael de13ab3adc
Fix warning in bencode 5 years ago
Ryan Tharp 547cf96606 make macos 10.12 happy 5 years ago
Ryan Tharp 2b433f046d
Oh it was a typo 5 years ago
Ryan Tharp 8e000c8321
linux gcc 7.3 support 5 years ago
Ryan Tharp f06b275193
make macos happy 5 years ago
Rick V 0f45e286ff
XXX: the inline string_view constructors *should* be harmless on pre-C++17 platforms...
fix windows build
5 years ago
Ryan Tharp 8e51d3a491 fix linux gcc 7.3 error (warning) 5 years ago
Michael a00d6afc5e
Convert llarp_buffer_t to be a class with methods 5 years ago
Michael e5eda0fb8f
Move lokinet unspecific components to a util/ library 6 years ago