@@ -1122,38 +1122,11 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
1122
1122
// Detailed error printed inside CreatePidFile().
1123
1123
return false ;
1124
1124
}
1125
- if (LogInstance ().m_print_to_file ) {
1126
- if (args.GetBoolArg (" -shrinkdebugfile" , LogInstance ().DefaultShrinkDebugFile ())) {
1127
- // Do this first since it both loads a bunch of debug.log into memory,
1128
- // and because this needs to happen before any other debug.log printing
1129
- LogInstance ().ShrinkDebugFile ();
1130
- }
1131
- }
1132
- if (!LogInstance ().StartLogging ()) {
1133
- return InitError (strprintf (Untranslated (" Could not open debug log file %s" ),
1134
- LogInstance ().m_file_path .string ()));
1135
- }
1136
-
1137
- if (!LogInstance ().m_log_timestamps )
1138
- LogPrintf (" Startup time: %s\n " , FormatISO8601DateTime (GetTime ()));
1139
- LogPrintf (" Default data directory %s\n " , GetDefaultDataDir ().string ());
1140
- LogPrintf (" Using data directory %s\n " , GetDataDir ().string ());
1141
-
1142
- // Only log conf file usage message if conf file actually exists.
1143
- fs::path config_file_path = GetConfigFile (args.GetArg (" -conf" , BITCOIN_CONF_FILENAME));
1144
- if (fs::exists (config_file_path)) {
1145
- LogPrintf (" Config file: %s\n " , config_file_path.string ());
1146
- } else if (args.IsArgSet (" -conf" )) {
1147
- // Warn if no conf file exists at path provided by user
1148
- InitWarning (strprintf (_ (" The specified config file %s does not exist" ), config_file_path.string ()));
1149
- } else {
1150
- // Not categorizing as "Warning" because it's the default behavior
1151
- LogPrintf (" Config file: %s (not found, skipping)\n " , config_file_path.string ());
1125
+ if (!init::StartLogging (args)) {
1126
+ // Detailed error printed inside StartLogging().
1127
+ return false ;
1152
1128
}
1153
1129
1154
- // Log the config arguments to debug.log
1155
- args.LogArgs ();
1156
-
1157
1130
LogPrintf (" Using at most %i automatic connections (%i file descriptors available)\n " , nMaxConnections, nFD);
1158
1131
1159
1132
// Warn about relative -datadir path.
0 commit comments