Skip to content

nano_rpc: Error: logging should be initialized before creating a logger #4691

@milahu

Description

@milahu

continue #4680 (comment) for better visibility

Error: logging should be initialized before creating a logger
$ ./result/bin/nano_rpc --help
Assertion (global_initialized) failed
nano::logger::logger(std::string)
/build/source/nano/lib/logging.cpp:220
Error: logging should be initialized before creating a logger

 0# 0x00000000005B5357 in ./result/bin/nano_rpc
 1# 0x00000000005AF0F8 in ./result/bin/nano_rpc
 2# 0x000000000055F6D2 in ./result/bin/nano_rpc
 3# 0x000000000049990A in ./result/bin/nano_rpc
 4# __libc_start_main in /nix/store/apab5i73dqa09wx0q27b6fbhd1r18ihl-glibc-2.39-31/lib/libc.so.6
 5# 0x000000000049E475 in ./result/bin/nano_rpc

Aborted (core dumped)

low priority, because nano_rpc is just an rpc client

the problem is that nano::logger::logger is called before nano::logger::initialize

nano/nano_rpc/entry.cpp

namespace
{
nano::logger logger{ "rpc_daemon" };

the fix will be similar to #4680

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions