Commit Graph

31 Commits

Author SHA1 Message Date
Jason Rhinelander
f6019210c3
oxen-logging update to handle level/type parsing exceptions 2022-07-19 13:39:00 -03:00
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).
2022-07-15 22:17:59 -03:00
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
2022-02-17 16:30:17 -04:00
Jeff
810e3cc9c2 dont capture flow_addr, results in compiler error on sid 2022-02-06 13:27:19 -05:00
Jeff Becker
04b23416ed do less allocations in lokinet_hex_tobase32z 2022-01-31 10:53:48 -05:00
Jeff Becker
743bc2433a resolve race condition in udp flow and packet handling 2022-01-31 10:53:48 -05:00
Jeff Becker
635f4bcd8c make it compile 2022-01-31 10:53:48 -05:00
Jeff Becker
5286d442fb updates:
* add udptest example
* fix up udp codepath in liblokinet
2022-01-31 10:53:48 -05:00
Jeff Becker
65b29a1b70 add liblokinet custom logger 2022-01-31 10:53:48 -05:00
Jeff Becker
f5157c31da make it compile 2022-01-31 10:53:48 -05:00
Jeff Becker
b225ec1043 thread safety stuff 2022-01-31 10:53:48 -05:00
Jeff Becker
ba57ab04aa wire up liblokient_udp_* 2022-01-31 10:53:48 -05:00
Jeff Becker
1c70b0f42f add lokinet_hex_to_base32z 2022-01-31 10:53:48 -05:00
Jeff Becker
66de680884 sanity check 2022-01-31 10:53:48 -05:00
Jeff Becker
8c8f97adda more logging 2022-01-31 10:53:48 -05:00
Jeff Becker
38d4cec7d1 log errors on decoding 2022-01-31 10:53:48 -05:00
Jeff Becker
c5b5ff7810 typo fix 2022-01-31 10:53:48 -05:00
Jeff Becker
2428cc189e llarp::BootstrapConfig update
* make routers member a llarp::BootstrapList
2022-01-31 10:53:48 -05:00
Jeff Becker
c4b1a9c074 lokinet_add_bootstrap_rc
* allow bootstrap lists to be passed in
2022-01-31 10:53:48 -05:00
Jason Rhinelander
f9395cd5dd Cleanup: avoid pointless copy of this pointer 2021-11-15 13:38:00 -04:00
Jeff Becker
046ab3d453
export functions in liblokinet for win32 dll 2021-06-08 08:32:52 -04:00
Jeff Becker
83b0f25075
cleanup after rebase 2021-04-19 07:19:07 -04:00
Jeff Becker
f63122272d
fix some compiler errors 2021-04-19 07:03:57 -04:00
Jeff Becker
545021aa3d
temp commit 2021-04-19 07:02:46 -04:00
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
2021-04-19 07:00:27 -04:00
Jeff Becker
3f9e51e391
more liblokinet api functions
* get/set netid
* set log level
2021-04-19 06:59:07 -04:00
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
2021-04-19 06:59:07 -04:00
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
2021-04-19 06:59:07 -04:00
Jeff Becker
8bc60a59ac
fix up liblokinet api to be more friendly to ffi
add lnproxy exmaple of use of liblokinet
2021-04-19 06:59:06 -04:00
Jeff Becker
853cc52efb
wire up liblokinet 2021-04-19 06:59:06 -04:00
Jeff Becker
e4841917ba
redo cmake parts
* add liblokinet.so target
* make every library we build except liblokinet.so static
* wire up parts of liblokinet
2021-04-19 06:52:24 -04:00