Commit Graph

30 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
Jason Rhinelander d02558350a
Crank oxen-mq to (1.2.)11; switch to oxen-encoding
- Update oxen-mq submodule to latest stable
- Add oxen-encoding submodule
- Convert all oxenmq encoding usage to oxenc
- Modernize cmake handling of oxenmq/oxenc
2 years ago
Jeff 810e3cc9c2 dont capture flow_addr, results in compiler error on sid 2 years ago
Jeff Becker 04b23416ed do less allocations in lokinet_hex_tobase32z 2 years ago
Jeff Becker 743bc2433a resolve race condition in udp flow and packet handling 2 years ago
Jeff Becker 635f4bcd8c make it compile 2 years ago
Jeff Becker 5286d442fb updates:
* add udptest example
* fix up udp codepath in liblokinet
2 years ago
Jeff Becker 65b29a1b70 add liblokinet custom logger 2 years ago
Jeff Becker f5157c31da make it compile 2 years ago
Jeff Becker b225ec1043 thread safety stuff 2 years ago
Jeff Becker ba57ab04aa wire up liblokient_udp_* 2 years ago
Jeff Becker 1c70b0f42f add lokinet_hex_to_base32z 2 years ago
Jeff Becker 66de680884 sanity check 2 years ago
Jeff Becker 8c8f97adda more logging 2 years ago
Jeff Becker 38d4cec7d1 log errors on decoding 2 years ago
Jeff Becker c5b5ff7810 typo fix 2 years ago
Jeff Becker 2428cc189e llarp::BootstrapConfig update
* make routers member a llarp::BootstrapList
2 years ago
Jeff Becker c4b1a9c074 lokinet_add_bootstrap_rc
* allow bootstrap lists to be passed in
2 years ago
Jason Rhinelander f9395cd5dd Cleanup: avoid pointless copy of `this` pointer 3 years ago
Jeff Becker 046ab3d453
export functions in liblokinet for win32 dll 3 years ago
Jeff Becker 83b0f25075
cleanup after rebase 3 years ago
Jeff Becker f63122272d
fix some compiler errors 3 years ago
Jeff Becker 545021aa3d
temp commit 3 years ago
Jeff Becker 2ed0ab1ca1
liblokinet and lnproxy updates
* add lokinet_status function to get the current status of the context, aka are we ready to send or not.
* catch some exceptions in lnproxy
3 years ago
Jeff Becker 3f9e51e391
more liblokinet api functions
* get/set netid
* set log level
3 years ago
Jeff Becker 2188b443e9
more liblokinet api stuff
* add lokinet_wait_for_ready to wait until we have published introsets and such
* optionally expose ports in lnproxy
* dont save profiles by default
3 years ago
Jeff Becker 95cd275cdd
liblokinet additions:
* add lokinet_add_bootstrap_rc function for adding an rc from memory
* prevent stack overflow on error closing connection in quic
* add in memory nodedb
* refactor how convotags are set as active
* add initial stubs for endpoint statistics
* refactor time stuff to be a bit cleaner
* update lnproxy script with more arguments
3 years ago
Jeff Becker 8bc60a59ac
fix up liblokinet api to be more friendly to ffi
add lnproxy exmaple of use of liblokinet
3 years ago
Jeff Becker 853cc52efb
wire up liblokinet 3 years ago
Jeff Becker e4841917ba
redo cmake parts
* add liblokinet.so target
* make every library we build except liblokinet.so static
* wire up parts of liblokinet
3 years ago