Apparently when no tty is attached, which is the case for Docker, the
buffer size for stdout increases to the point that only half of the
entire log might be written.
bootstrap_node_packets.c was giving an error as it was being included
twice and there were no include guards, so part of it was split into
bootstrap_node_packets.h.
Useful for things like a Docker container or just running it in the
terminal.
Complements the stdout logging option. This is actually why the stdout
logging was added in the first place -- to be used in the foreground
mode, though nothing stops one from using stdout in the background
mode, which one could redirect to a file.
Passing Logger object into every function isn't fun. See for yourself:
something as simple as a public key printing function turns from
>void print_public_key(const uint8_t *public_key)
to
>void print_public_key(Logger *logger, const uint8_t *public_key)
Some of them were set incorrectly, e.g. something that caused the
daemon to exit was marked as just a warning, instead of an error.
Removed debug level as it was hard to decide whether something should
go into info or debug. This is mostly because the use of the debug level
wasn't well defined. Debug should be used for information that could
help a user to debug an issue, but messages marked as debug were by the
most part the "success" log messages, which could go into info level
instead.
@arthurtiteica has pointed out that systemd has more suitable facilities for
creating a temporary directory for a PID file rather than calling ExecStartPre,
which requires an absolute path to coreutils executables we used for creating a
directory and changing its owner, paths of which are are not universal across
distributions. Systemd can take care of it for us without need to provide
absolute paths, which is what we use here.