mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Adjust some log statement levels
Largely so that LOOT's logging can run at info verbosity by default instead of warn without too much detail in the log output. I've also moved some statements between trace and debug based on how useful I think they'd be when debugging issues.
This commit is contained in:
@@ -88,7 +88,7 @@ LoadOrderHandler::LoadOrderHandler(
|
||||
void LoadOrderHandler::LoadCurrentState() {
|
||||
auto logger = getLogger();
|
||||
if (logger) {
|
||||
logger->info("Loading the current load order state.");
|
||||
logger->trace("Loading the current load order state.");
|
||||
}
|
||||
|
||||
const unsigned int ret = lo_load_current_state(gh_.get());
|
||||
@@ -192,16 +192,15 @@ void LoadOrderHandler::SetLoadOrder(
|
||||
const std::vector<std::string>& loadOrder) const {
|
||||
auto logger = getLogger();
|
||||
if (logger) {
|
||||
logger->info("Setting load order.");
|
||||
logger->debug("Setting load order:");
|
||||
for (const auto& plugin : loadOrder) {
|
||||
logger->debug("\t{}", plugin);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<const char*> plugins;
|
||||
plugins.reserve(loadOrder.size());
|
||||
for (const auto& plugin : loadOrder) {
|
||||
if (logger) {
|
||||
logger->info("\t\t{}", plugin);
|
||||
}
|
||||
|
||||
plugins.push_back(plugin.c_str());
|
||||
}
|
||||
|
||||
@@ -211,7 +210,7 @@ void LoadOrderHandler::SetLoadOrder(
|
||||
HandleError("set the load order", ret);
|
||||
|
||||
if (logger) {
|
||||
logger->info("Load order set successfully.");
|
||||
logger->debug("Load order set successfully.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ void MetadataList::Load(const std::filesystem::path& filepath) {
|
||||
|
||||
auto logger = getLogger();
|
||||
if (logger) {
|
||||
logger->debug("Loading file: {}", filepath.u8string());
|
||||
logger->trace("Loading file: {}", filepath.u8string());
|
||||
}
|
||||
|
||||
std::ifstream in(filepath);
|
||||
@@ -227,7 +227,8 @@ void MetadataList::Load(std::istream& istream,
|
||||
|
||||
auto logger = getLogger();
|
||||
if (logger) {
|
||||
logger->debug("File loaded successfully.");
|
||||
logger->trace("Successfully loaded metadata from file at \"{}\".",
|
||||
source_path.u8string());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -269,8 +269,8 @@ bool Plugin::IsValid(const GameType gameType,
|
||||
|
||||
auto logger = getLogger();
|
||||
if (logger) {
|
||||
logger->info("The file \"{}\" is not a valid plugin.",
|
||||
pluginPath.filename().u8string());
|
||||
logger->debug("The file \"{}\" is not a valid plugin.",
|
||||
pluginPath.filename().u8string());
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -187,7 +187,7 @@ GetTransitiveAfterGroups(const std::vector<Group>& masterlistGroups,
|
||||
|
||||
auto logger = getLogger();
|
||||
if (logger) {
|
||||
logger->info("Sorting groups according to their load after data");
|
||||
logger->trace("Sorting groups according to their load after data");
|
||||
}
|
||||
|
||||
// Check for cycles.
|
||||
@@ -214,7 +214,7 @@ GetTransitiveAfterGroups(const std::vector<Group>& masterlistGroups,
|
||||
transitiveAfterGroups[graph[vertex]] = visitedGroups;
|
||||
|
||||
if (logger) {
|
||||
logger->trace("Group \"{}\" transitively loads after groups \"{}\"",
|
||||
logger->debug("Group \"{}\" transitively loads after groups \"{}\"",
|
||||
graph[vertex],
|
||||
joinUnorderedSet(visitedGroups));
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ void PluginGraph::AddEdge(const vertex_t& fromVertex,
|
||||
|
||||
auto logger = getLogger();
|
||||
if (logger) {
|
||||
logger->trace("Adding {} edge from \"{}\" to \"{}\".",
|
||||
logger->debug("Adding {} edge from \"{}\" to \"{}\".",
|
||||
describeEdgeType(edgeType),
|
||||
GetPlugin(fromVertex).GetName(),
|
||||
GetPlugin(toVertex).GetName());
|
||||
@@ -650,7 +650,7 @@ void PluginGraph::AddHardcodedPluginEdges(const Game& game) {
|
||||
loot::equivalent(game.DataPath() / u8path(plugin),
|
||||
game.DataPath() / "update.esm")) {
|
||||
if (logger) {
|
||||
logger->trace(
|
||||
logger->debug(
|
||||
"Skipping adding hardcoded plugin edges for Update.esm as it does "
|
||||
"not have a hardcoded position for Skyrim.");
|
||||
continue;
|
||||
@@ -661,7 +661,7 @@ void PluginGraph::AddHardcodedPluginEdges(const Game& game) {
|
||||
|
||||
if (!pluginVertex.has_value()) {
|
||||
if (logger) {
|
||||
logger->trace(
|
||||
logger->debug(
|
||||
"Skipping adding hardcoded plugin edges for \"{}\" as it has not "
|
||||
"been loaded.",
|
||||
plugin);
|
||||
@@ -707,7 +707,7 @@ void PluginGraph::AddGroupEdges(
|
||||
const auto& fromPlugin = GetPlugin(parentVertex.value());
|
||||
|
||||
if (logger) {
|
||||
logger->trace(
|
||||
logger->debug(
|
||||
"Skipping group edge from \"{}\" to \"{}\" as it would "
|
||||
"create a cycle.",
|
||||
fromPlugin.GetName(),
|
||||
@@ -762,7 +762,7 @@ void PluginGraph::AddGroupEdges(
|
||||
if (!ignore) {
|
||||
AddEdge(edgePair.first, edgePair.second, EdgeType::group);
|
||||
} else if (logger) {
|
||||
logger->trace(
|
||||
logger->debug(
|
||||
"Skipping group edge from \"{}\" to \"{}\" as it would "
|
||||
"create a multi-group cycle.",
|
||||
fromPlugin.GetName(),
|
||||
@@ -783,7 +783,7 @@ void PluginGraph::AddOverlapEdges() {
|
||||
|
||||
if (plugin.NumOverrideFormIDs() == 0) {
|
||||
if (logger) {
|
||||
logger->trace(
|
||||
logger->debug(
|
||||
"Skipping vertex for \"{}\": the plugin contains no override "
|
||||
"records.",
|
||||
plugin.GetName());
|
||||
|
||||
@@ -42,9 +42,9 @@ std::vector<std::string> SortPlugins(
|
||||
|
||||
auto logger = getLogger();
|
||||
if (logger) {
|
||||
logger->info("Current load order: ");
|
||||
logger->debug("Current load order:");
|
||||
for (const auto& plugin : loadOrder) {
|
||||
logger->info("\t\t{}", plugin);
|
||||
logger->debug("\t{}", plugin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,9 +84,9 @@ std::vector<std::string> SortPlugins(
|
||||
const auto newLoadOrder = graph.ToPluginNames(path);
|
||||
|
||||
if (logger) {
|
||||
logger->info("Calculated order: ");
|
||||
logger->debug("Calculated order:");
|
||||
for (const auto& name : newLoadOrder) {
|
||||
logger->info("\t{}", name);
|
||||
logger->debug("\t{}", name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user