Commit Graph

29 Commits (b81f7025c9a619409bb1c3f39e0c56e2084fd7be)

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
Jeff 1eba0f836e
replace LLARP_PROTO_VERSION macro 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
Jason Rhinelander 3bb24580a4 make format 4 years ago
Jason Rhinelander ebd2142114 Don't use std::optional::value() because f u macos
This replaces all use of std::optional's `opt.value()` with `*opt`
because macOS is great and the ghost of Steve Jobs says that actually
supporting std::optional's value() method is not for chumps before macOS
10.14.  So don't use it because Apple is great.

Pretty much all of our use of it actually is done better with operator*
anyway (since operator* doesn't do a check that the optional has a
value).

Also replaced *most* of the `has_value()` calls with direct bool
context, except for one in the config section which looked really
confusing at a glance without a has_value().
4 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 e6174efa21
don't derive x25519 key from ed25519 key 4 years ago
Jeff Becker 99eb7726ff
initial dht key blinding 4 years ago
Jeff Becker 8b8d636ded
make format 4 years ago
Thomas Winget 71bb0dd520 implement timers using libuv
So far only a bit of the code using timers has been modified to use
the new libuv-based timers.  Also only the non-Windows case has been
implemented.  Seems to be working though, so it's a good time to commit.
4 years ago
Jeff Becker 7f6d1ebb92
fix slow start bug 4 years ago
Jeff Becker 1a864832c8
make format 5 years ago
Thomas Winget 23a9773e1e
remove our paths from outbound queues 5 years ago
Michael 491fee206b
Port code to use CryptoManager over passing Crypto pointers 5 years ago
Michael 98e691f315
Tidy up more parts of the service/ directory 5 years ago
Michael e4cf1f245c
Convert most of llarp to use Printer 5 years ago
Michael f3b0af9d2f
Create CopyableBuffer type 5 years ago
Michael 2de621b0ad
Disable copy constructing llarp_buffer_t 5 years ago
Michael 79157414f3
Split crypto.hpp into 3 different files 5 years ago
Michael e5eda0fb8f
Move lokinet unspecific components to a util/ library 5 years ago
Michael 334161c9bb
Remove data() conversions from llarp::AlignedBuffer 5 years ago
Michael 037cb87523
Convert llarp::AlignedBuffer to be backed by std::array 5 years ago
Michael e887b4e9c7
Move service* to llarp/ 6 years ago
Jeff Becker 4411d85040
fix headers 6 years ago
Jeff Becker c262f8b5e3
bundle relevent libsodium parts 6 years ago
Jeff Becker e79708c1dc
hidden services sorta work 6 years ago
Jeff Becker dbe4a35230 add sequence numbers to routing messages 6 years ago
Jeff Becker 5d5757cbec more dht stuff 6 years ago
Jeff Becker 0242e293c9 more 6 years ago