These pieces of code:
https://github.com/bitcoin/bitcoin/blob/8ab4f282c06d67074b872dbda0be37636fdd5186/src/util/system.cpp#L302
and
https://github.com/bitcoin/bitcoin/blob/8ab4f282c06d67074b872dbda0be37636fdd5186/src/util/system.cpp#L864
do not work as expected because they are called before the `InitLogging()` call.

{
    private:
        FILE* m_fileout = nullptr;
        std::mutex m_file_mutex;
        std::list<std::string> m_msgs_before_open;
        bool m_buffering = true; 
        /**
         * m_started_new_line is a state variable that will suppress printing of
         * the timestamp when multiple calls are made that don't end in a
         * newline.
         */
        std::atomic_bool m_started_new_line{true};
        
        std::atomic<uint32_t> m_categories{0};
        std::string LogTimestampStr(const std::string& str);
    public:
        bool m_print_to_console = false;
        bool m_print_to_file = false;
        bool m_log_timestamps = DEFAULT_LOGTIMESTAMPS;
        bool m_log_time_micros = DEFAULT_LOGTIMEMICROS;
        bool m_log_threadnames = DEFAULT_LOGTHREADNAMES;
        fs::path m_file_path;
        std::atomic<bool> m_reopen_file{false};
        
        void LogPrintStr(const std::string &str);
        
        bool Enabled() const { return m_buffering || m_print_to_console || m_print_to_file; }