# HG changeset patch # User Eddi-z <43699911+Eddi-z@users.noreply.github.com> # Date 2022-12-15 18:25:06 # Node ID f651513a27e6da0efae2a833c6e809fb60b9ee35 # Parent 9b76e6eb655a5a0f7510448e501e06cbd352b740 Codechange: Reshuffle debuglevels in fileio to address spammyness (#10240) diff --git a/src/fileio.cpp b/src/fileio.cpp --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -418,7 +418,7 @@ uint TarScanner::DoScan(Subdirectory sd) /* static */ uint TarScanner::DoScan(TarScanner::Mode mode) { - Debug(misc, 1, "Scanning for tars"); + Debug(misc, 2, "Scanning for tars"); TarScanner fs; uint num = 0; if (mode & TarScanner::BASESET) { @@ -439,7 +439,7 @@ uint TarScanner::DoScan(Subdirectory sd) num += fs.DoScan(SCENARIO_DIR); num += fs.DoScan(HEIGHTMAP_DIR); } - Debug(misc, 1, "Scan complete, found {} files", num); + Debug(misc, 2, "Scan complete, found {} files", num); return num; } @@ -571,7 +571,7 @@ bool TarScanner::AddFile(const std::stri /* Only allow relative links */ if (link[0] == PATHSEPCHAR) { - Debug(misc, 1, "Ignoring absolute link in tar: {} -> {}", name, link); + Debug(misc, 5, "Ignoring absolute link in tar: {} -> {}", name, link); break; } @@ -597,7 +597,7 @@ bool TarScanner::AddFile(const std::stri } else if (strcmp(pos, "..") == 0) { /* level up */ if (dest[0] == '\0') { - Debug(misc, 1, "Ignoring link pointing outside of data directory: {} -> {}", name, link); + Debug(misc, 5, "Ignoring link pointing outside of data directory: {} -> {}", name, link); break; } @@ -652,7 +652,7 @@ bool TarScanner::AddFile(const std::stri pos += skip; } - Debug(misc, 1, "Found tar '{}' with {} new files", filename, num); + Debug(misc, 4, "Found tar '{}' with {} new files", filename, num); fclose(f); /* Resolve file links and store directory links. @@ -690,7 +690,7 @@ bool ExtractTar(const std::string &tar_f /* The file doesn't have a sub directory! */ if (dirname.empty()) { - Debug(misc, 1, "Extracting {} failed; archive rejected, the contents must be in a sub directory", tar_filename); + Debug(misc, 3, "Extracting {} failed; archive rejected, the contents must be in a sub directory", tar_filename); return false; } @@ -987,7 +987,7 @@ void DeterminePaths(const char *exe, boo for (Searchpath sp : _valid_searchpaths) { if (sp == SP_WORKING_DIR && !_do_scan_working_directory) continue; - Debug(misc, 4, "{} added as search path", _searchpaths[sp]); + Debug(misc, 3, "{} added as search path", _searchpaths[sp]); } std::string config_dir; @@ -1020,7 +1020,7 @@ void DeterminePaths(const char *exe, boo _config_file = config_dir + "openttd.cfg"; } - Debug(misc, 3, "{} found as config directory", config_dir); + Debug(misc, 1, "{} found as config directory", config_dir); _highscore_file = config_dir + "hs.dat"; extern std::string _hotkeys_file; @@ -1056,7 +1056,7 @@ void DeterminePaths(const char *exe, boo FioCreateDirectory(_personal_dir); #endif - Debug(misc, 3, "{} found as personal directory", _personal_dir); + Debug(misc, 1, "{} found as personal directory", _personal_dir); static const Subdirectory default_subdirs[] = { SAVE_DIR, AUTOSAVE_DIR, SCENARIO_DIR, HEIGHTMAP_DIR, BASESET_DIR, NEWGRF_DIR, AI_DIR, AI_LIBRARY_DIR, GAME_DIR, GAME_LIBRARY_DIR, SCREENSHOT_DIR @@ -1068,7 +1068,7 @@ void DeterminePaths(const char *exe, boo /* If we have network we make a directory for the autodownloading of content */ _searchpaths[SP_AUTODOWNLOAD_DIR] = _personal_dir + "content_download" PATHSEP; - Debug(misc, 4, "{} added as search path", _searchpaths[SP_AUTODOWNLOAD_DIR]); + Debug(misc, 3, "{} added as search path", _searchpaths[SP_AUTODOWNLOAD_DIR]); FioCreateDirectory(_searchpaths[SP_AUTODOWNLOAD_DIR]); FillValidSearchPaths(only_local_path);