Commit Graph

35 Commits

Author SHA1 Message Date
tomFlowee df4e1de6fd Add new log channel FastLogChannel
This log channel copies the log line and instantly returns to allow the
main codebase to not have an impact on logging speed.

Normal usage this isn't really relevant, but for cases where we want a
massive amount of logging for performance tuning the logging ends up
being a bottle-neck. Well, not logging but the output channel ends up
being a IO based bottleneck.
This log channel moves the IO based work to its own thread in order
to ensure that the main code works at full speed.
2026-04-10 23:30:57 +02:00
tomFlowee 7bb45a6867 Cleanup unused LogPrint data structs 2025-01-13 23:46:29 +01:00
tomFlowee 4560355458 Introduce a different general log category. 2025-01-13 23:37:51 +01:00
tomFlowee 3becd7aa45 Remove unused log sections and code
Decentralized all things!

But, really, don't put the logging sections for external apps in the
library code.
2023-04-04 15:47:25 +02:00
tomFlowee 6de770466b Avoid possible references-of-deleted
This sanity check might avoid issues in future code by not assuming a
log channel (or anything it depends on) will avoid using logging at the
moment it is shutting down.
2022-11-25 14:01:05 +01:00
tomFlowee f3fb02a522 Make channel interface available
The manager now has an addChannel() method for anyone wanting to
implement a separate logging channel.
2022-11-24 18:14:14 +01:00
tomFlowee f798bf6fe5 On adding log-file output, instantly open it.
This allows this API to be used in more places and do the expected
thing.
2022-11-11 19:03:57 +01:00
tomFlowee 82ca91d836 Use slightly less memory.
This avoids creating an empty static string in most well written apps.
Also use const ref for a loop because that avoids copying.
2022-07-06 14:08:18 +02:00
tomFlowee ae78dd0bb8 Update email address 2021-06-20 22:44:44 +02:00
TomZ 370abe4c1e Follow several code-check suggestions
Also print a line explaining which file the logs go to in case there
is no config.
2020-08-26 14:08:03 +02:00
TomZ 25ffc84f80 Introduce new lib p2p
We reuse the NetworkManager lower level code in order to connect
to the Bitcoin P2P network.
This implements the basics for anyone wanting to be a player on
this network.
2020-04-20 21:49:03 +02:00
TomZ 05048a2109 make non-debug builds more useful for unit tests in debug build 2020-02-19 16:55:46 +01:00
TomZ 999772a748 Allow usage of the logger outside of Flowee
Ship unit-testing functionality in the releease builds too,
external users may want to compile their apps in debug mode while
flowee is a release build.
2020-01-30 15:29:03 +01:00
TomZ 071629852a Treat DSP orphans with dignity
This improves the double spend proof orphans code.
Also add a DSProof log-category and lots of log lines to make
looking at a debug build much more fun.
2020-01-12 17:41:53 +01:00
TomZ 2e37162aa1 AppUtils lib; add search API
The core APIs in Flowee are quite low-level and especially combining
results from multiple services becomes tedius, verbose and thus
error-prone.

For this reason I wrote a new SearchEngine and related classes which
allow one to create a single compound request, submit it to the engine and
get a callback when it is done.

For instance one can now create a request for a transaction by txid and the
system will split this into a txid-lookup and the actual fetch for the
transaction.
Enough callbacks and options exist to be able to add a lot more details
this way in a simple manner.
2019-09-23 11:03:36 +02:00
TomZ 7390bea9eb Use proper integer width in api. 2019-09-13 23:45:53 +02:00
TomZ d8248aa821 Small refactor; move code.
Move some methods about arguments from util.cpp to Logger.
This makes the logger more stand-alone and this avoids the
global defined in util.h (still to be fixed in future..)
2019-08-23 22:48:39 +02:00
TomZ c1fa50d7f8 Handle when user asked to log to a file we can't open
This now logs that problem to the console.
2019-08-12 21:51:42 +02:00
TomZ 08c7502bab Make logger log errors found at config parse time. 2019-08-05 23:00:52 +02:00
TomZ d20dd6d70a Cleanup; block-pruning
This has been commented out code for some time and its probably best to
remove dead code so as to avoid it rotting.
2019-04-22 20:33:49 +02:00
TomZ 2b0260bdf5 fix unneeded space after exception log message 2019-04-21 17:32:41 +02:00
TomZ 78219d5bba Make the indexer-cli and indexer interact well
This adds lots of little things;
* Add GetTransaction API call
* I refactored the GetBlock API a little to reuse code.
* a new 'Version' API call for the hub
* API for the logging manager, so we can set a default
  setup with just C++-APIs
* various (usability) fixes in the FloweeServiceApplication
* Binding to localhost attempts to bind to both IPv4 and v6
* Print the actual transaction hex from indexer-cli (which really
  is just a testing app)
2019-04-10 20:52:04 +02:00
TomZ aea9c25c15 Make indexer-cli have more suitable output 2019-04-10 15:38:37 +02:00
TomZ 6647cd0fc9 Move default log level to ignore Info but print Warning 2019-03-27 21:24:19 +01:00
TomZ 82a670787e Merge branch 'master' into UnspentOutputDB
Conflicts:
	testing/prevector/test_prevector.cpp
	testing/test/test_bitcoin.cpp
	testing/utxo/test_utxo.cpp
2018-08-15 20:30:45 +02:00
TomZ c182d809fb Make logging now be tuned for qtestlib
as the boost testlib is too erretic and gives us bugs, make the common
framework support qtestlib instead
2018-08-14 15:53:00 +02:00
TomZ 6ab9e96071 log UTXO by text 2018-08-04 18:44:14 +02:00
TomZ 438f9d4f1b Add generic testing decorator
This integrates unit tests into the logging system
so I can see the unit test we are currently in reflected in the log-
line.
2018-05-09 10:48:16 +02:00
TomZ 9118faedae Without config, log to file. 2018-03-16 23:33:16 +01:00
TomZ 22b91334b5 Several logging improvements;
* logs.conf now also found directly in the homedir if there is no
$HOME/.config dir
* default filename is now 'hub.log' instead of 'debug.log'
* logs.conf now also detects ALL as a keyword for section
* logs.conf now also supports 'option path [path]'
2018-03-08 19:32:14 +01:00
TomZ 72593ea6a5 Merge branch 'master' into pos 2018-02-17 19:02:18 +01:00
TomZ ee38f6ac09 Merge with rename to api server 2018-02-17 14:47:51 +01:00
TomZ 4635c7a7c4 Rename "AdminServer" to "APIServer"
The change signifies that the server is not just for admin purposes it
will become the preferred way for all subnet-local interactions.

Notice that we still have the JSON based RPC protocol as fallback.
2018-02-17 14:47:51 +01:00
TomZ ace04a5070 Remove debug sections configuration via commandline. 2018-02-16 12:36:11 +01:00
TomZ b76ca3a97e Start libs/utils 2018-02-13 13:27:58 +01:00