mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-09-12 11:37:27 +00:00
feat: verbose option sets log level to debug
This commit is contained in:
@@ -79,8 +79,7 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]{
|
|||||||
};
|
};
|
||||||
|
|
||||||
ImageConverterArgs::ImageConverterArgs()
|
ImageConverterArgs::ImageConverterArgs()
|
||||||
: m_verbose(false),
|
: m_game_to_convert_to(image_converter::Game::UNKNOWN),
|
||||||
m_game_to_convert_to(image_converter::Game::UNKNOWN),
|
|
||||||
m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v<decltype(COMMAND_LINE_OPTIONS)>)
|
m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v<decltype(COMMAND_LINE_OPTIONS)>)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -105,11 +104,6 @@ void ImageConverterArgs::PrintVersion()
|
|||||||
con::info("OpenAssetTools ImageConverter {}", GIT_VERSION);
|
con::info("OpenAssetTools ImageConverter {}", GIT_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageConverterArgs::SetVerbose(const bool isVerbose)
|
|
||||||
{
|
|
||||||
m_verbose = isVerbose;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ImageConverterArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
bool ImageConverterArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
||||||
{
|
{
|
||||||
shouldContinue = true;
|
shouldContinue = true;
|
||||||
@@ -144,7 +138,10 @@ bool ImageConverterArgs::ParseArgs(const int argc, const char** argv, bool& shou
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -v; --verbose
|
// -v; --verbose
|
||||||
SetVerbose(m_argument_parser.IsOptionSpecified(OPTION_VERBOSE));
|
if (m_argument_parser.IsOptionSpecified(OPTION_VERBOSE))
|
||||||
|
con::globalLogLevel = con::LogLevel::DEBUG;
|
||||||
|
else
|
||||||
|
con::globalLogLevel = con::LogLevel::INFO;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,6 @@ public:
|
|||||||
ImageConverterArgs();
|
ImageConverterArgs();
|
||||||
bool ParseArgs(int argc, const char** argv, bool& shouldContinue);
|
bool ParseArgs(int argc, const char** argv, bool& shouldContinue);
|
||||||
|
|
||||||
bool m_verbose;
|
|
||||||
std::vector<std::string> m_files_to_convert;
|
std::vector<std::string> m_files_to_convert;
|
||||||
image_converter::Game m_game_to_convert_to;
|
image_converter::Game m_game_to_convert_to;
|
||||||
|
|
||||||
@@ -36,7 +35,5 @@ private:
|
|||||||
static void PrintUsage();
|
static void PrintUsage();
|
||||||
static void PrintVersion();
|
static void PrintVersion();
|
||||||
|
|
||||||
void SetVerbose(bool isVerbose);
|
|
||||||
|
|
||||||
ArgumentParser m_argument_parser;
|
ArgumentParser m_argument_parser;
|
||||||
};
|
};
|
||||||
|
@@ -129,8 +129,7 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]{
|
|||||||
};
|
};
|
||||||
|
|
||||||
LinkerArgs::LinkerArgs()
|
LinkerArgs::LinkerArgs()
|
||||||
: m_verbose(false),
|
: m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v<decltype(COMMAND_LINE_OPTIONS)>)
|
||||||
m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v<decltype(COMMAND_LINE_OPTIONS)>)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,13 +159,6 @@ void LinkerArgs::SetBinFolder()
|
|||||||
m_bin_folder = path.parent_path().string();
|
m_bin_folder = path.parent_path().string();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinkerArgs::SetVerbose(const bool isVerbose)
|
|
||||||
{
|
|
||||||
m_verbose = isVerbose;
|
|
||||||
ObjLoading::Configuration.Verbose = isVerbose;
|
|
||||||
ObjWriting::Configuration.Verbose = isVerbose;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
bool LinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldContinue)
|
||||||
{
|
{
|
||||||
shouldContinue = true;
|
shouldContinue = true;
|
||||||
@@ -203,7 +195,10 @@ bool LinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldContin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -v; --verbose
|
// -v; --verbose
|
||||||
SetVerbose(m_argument_parser.IsOptionSpecified(OPTION_VERBOSE));
|
if (m_argument_parser.IsOptionSpecified(OPTION_VERBOSE))
|
||||||
|
con::globalLogLevel = con::LogLevel::DEBUG;
|
||||||
|
else
|
||||||
|
con::globalLogLevel = con::LogLevel::INFO;
|
||||||
|
|
||||||
// b; --base-folder
|
// b; --base-folder
|
||||||
if (m_argument_parser.IsOptionSpecified(OPTION_BASE_FOLDER))
|
if (m_argument_parser.IsOptionSpecified(OPTION_BASE_FOLDER))
|
||||||
|
@@ -17,8 +17,6 @@ public:
|
|||||||
LinkerArgs();
|
LinkerArgs();
|
||||||
bool ParseArgs(int argc, const char** argv, bool& shouldContinue);
|
bool ParseArgs(int argc, const char** argv, bool& shouldContinue);
|
||||||
|
|
||||||
bool m_verbose;
|
|
||||||
|
|
||||||
std::vector<std::string> m_zones_to_load;
|
std::vector<std::string> m_zones_to_load;
|
||||||
std::vector<std::string> m_project_specifiers_to_build;
|
std::vector<std::string> m_project_specifiers_to_build;
|
||||||
|
|
||||||
@@ -38,7 +36,6 @@ private:
|
|||||||
static void PrintVersion();
|
static void PrintVersion();
|
||||||
|
|
||||||
void SetBinFolder();
|
void SetBinFolder();
|
||||||
void SetVerbose(bool isVerbose);
|
|
||||||
|
|
||||||
ArgumentParser m_argument_parser;
|
ArgumentParser m_argument_parser;
|
||||||
};
|
};
|
||||||
|
@@ -6,7 +6,6 @@ public:
|
|||||||
static class Configuration_t
|
static class Configuration_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool Verbose = false;
|
|
||||||
bool MenuPermissiveParsing = false;
|
bool MenuPermissiveParsing = false;
|
||||||
bool MenuNoOptimization = false;
|
bool MenuNoOptimization = false;
|
||||||
} Configuration;
|
} Configuration;
|
||||||
|
@@ -26,14 +26,11 @@ void AbstractMaterialConstantZoneState::ExtractNamesFromZone()
|
|||||||
|
|
||||||
const auto end = std::chrono::high_resolution_clock::now();
|
const auto end = std::chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
if (ObjWriting::Configuration.Verbose)
|
|
||||||
{
|
|
||||||
const auto durationInMs = std::chrono::duration_cast<std::chrono::milliseconds>(end - begin);
|
const auto durationInMs = std::chrono::duration_cast<std::chrono::milliseconds>(end - begin);
|
||||||
con::debug("Built material constant name lookup in {}ms: {} constant names; {} texture def names",
|
con::debug("Built material constant name lookup in {}ms: {} constant names; {} texture def names",
|
||||||
durationInMs.count(),
|
durationInMs.count(),
|
||||||
m_constant_names_from_shaders.size(),
|
m_constant_names_from_shaders.size(),
|
||||||
m_texture_def_names_from_shaders.size());
|
m_texture_def_names_from_shaders.size());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AbstractMaterialConstantZoneState::GetConstantName(const unsigned hash, std::string& constantName) const
|
bool AbstractMaterialConstantZoneState::GetConstantName(const unsigned hash, std::string& constantName) const
|
||||||
|
@@ -26,7 +26,6 @@ public:
|
|||||||
GLB
|
GLB
|
||||||
};
|
};
|
||||||
|
|
||||||
bool Verbose = false;
|
|
||||||
std::vector<bool> AssetTypesToHandleBitfield;
|
std::vector<bool> AssetTypesToHandleBitfield;
|
||||||
|
|
||||||
ImageOutputFormat_e ImageOutputFormat = ImageOutputFormat_e::DDS;
|
ImageOutputFormat_e ImageOutputFormat = ImageOutputFormat_e::DDS;
|
||||||
|
@@ -65,8 +65,7 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]{
|
|||||||
};
|
};
|
||||||
|
|
||||||
RawTemplaterArguments::RawTemplaterArguments()
|
RawTemplaterArguments::RawTemplaterArguments()
|
||||||
: m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v<decltype(COMMAND_LINE_OPTIONS)>),
|
: m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v<decltype(COMMAND_LINE_OPTIONS)>)
|
||||||
m_verbose(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +119,10 @@ bool RawTemplaterArguments::ParseArgs(const int argc, const char** argv, bool& s
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -v; --verbose
|
// -v; --verbose
|
||||||
m_verbose = m_argument_parser.IsOptionSpecified(OPTION_VERBOSE);
|
if (m_argument_parser.IsOptionSpecified(OPTION_VERBOSE))
|
||||||
|
con::globalLogLevel = con::LogLevel::DEBUG;
|
||||||
|
else
|
||||||
|
con::globalLogLevel = con::LogLevel::INFO;
|
||||||
|
|
||||||
// -o; --output
|
// -o; --output
|
||||||
if (m_argument_parser.IsOptionSpecified(OPTION_OUTPUT_FOLDER))
|
if (m_argument_parser.IsOptionSpecified(OPTION_OUTPUT_FOLDER))
|
||||||
|
@@ -17,8 +17,6 @@ class RawTemplaterArguments
|
|||||||
static void PrintVersion();
|
static void PrintVersion();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool m_verbose;
|
|
||||||
|
|
||||||
std::vector<std::string> m_input_files;
|
std::vector<std::string> m_input_files;
|
||||||
std::string m_output_directory;
|
std::string m_output_directory;
|
||||||
|
|
||||||
|
@@ -146,8 +146,7 @@ UnlinkerArgs::UnlinkerArgs()
|
|||||||
m_minimal_zone_def(false),
|
m_minimal_zone_def(false),
|
||||||
m_asset_type_handling(AssetTypeHandling::EXCLUDE),
|
m_asset_type_handling(AssetTypeHandling::EXCLUDE),
|
||||||
m_skip_obj(false),
|
m_skip_obj(false),
|
||||||
m_use_gdt(false),
|
m_use_gdt(false)
|
||||||
m_verbose(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,13 +170,6 @@ void UnlinkerArgs::PrintVersion()
|
|||||||
con::info("OpenAssetTools Unlinker {}", GIT_VERSION);
|
con::info("OpenAssetTools Unlinker {}", GIT_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnlinkerArgs::SetVerbose(const bool isVerbose)
|
|
||||||
{
|
|
||||||
m_verbose = isVerbose;
|
|
||||||
ObjLoading::Configuration.Verbose = isVerbose;
|
|
||||||
ObjWriting::Configuration.Verbose = isVerbose;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UnlinkerArgs::SetImageDumpingMode() const
|
bool UnlinkerArgs::SetImageDumpingMode() const
|
||||||
{
|
{
|
||||||
auto specifiedValue = m_argument_parser.GetValueForOption(OPTION_IMAGE_FORMAT);
|
auto specifiedValue = m_argument_parser.GetValueForOption(OPTION_IMAGE_FORMAT);
|
||||||
@@ -303,7 +295,10 @@ bool UnlinkerArgs::ParseArgs(const int argc, const char** argv, bool& shouldCont
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -v; --verbose
|
// -v; --verbose
|
||||||
SetVerbose(m_argument_parser.IsOptionSpecified(OPTION_VERBOSE));
|
if (m_argument_parser.IsOptionSpecified(OPTION_VERBOSE))
|
||||||
|
con::globalLogLevel = con::LogLevel::DEBUG;
|
||||||
|
else
|
||||||
|
con::globalLogLevel = con::LogLevel::INFO;
|
||||||
|
|
||||||
// -min; --minimal-zone
|
// -min; --minimal-zone
|
||||||
m_minimal_zone_def = m_argument_parser.IsOptionSpecified(OPTION_MINIMAL_ZONE_FILE);
|
m_minimal_zone_def = m_argument_parser.IsOptionSpecified(OPTION_MINIMAL_ZONE_FILE);
|
||||||
|
@@ -24,8 +24,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
void PrintUsage() const;
|
void PrintUsage() const;
|
||||||
static void PrintVersion();
|
static void PrintVersion();
|
||||||
|
|
||||||
void SetVerbose(bool isVerbose);
|
|
||||||
bool SetImageDumpingMode() const;
|
bool SetImageDumpingMode() const;
|
||||||
bool SetModelDumpingMode() const;
|
bool SetModelDumpingMode() const;
|
||||||
|
|
||||||
@@ -60,8 +58,6 @@ public:
|
|||||||
bool m_skip_obj;
|
bool m_skip_obj;
|
||||||
bool m_use_gdt;
|
bool m_use_gdt;
|
||||||
|
|
||||||
bool m_verbose;
|
|
||||||
|
|
||||||
UnlinkerArgs();
|
UnlinkerArgs();
|
||||||
bool ParseArgs(int argc, const char** argv, bool& shouldContinue);
|
bool ParseArgs(int argc, const char** argv, bool& shouldContinue);
|
||||||
|
|
||||||
|
@@ -122,7 +122,6 @@ ZoneCodeGeneratorArguments::ZoneCodeGeneratorArguments()
|
|||||||
: m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v<decltype(COMMAND_LINE_OPTIONS)>),
|
: m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v<decltype(COMMAND_LINE_OPTIONS)>),
|
||||||
m_task_flags(0u)
|
m_task_flags(0u)
|
||||||
{
|
{
|
||||||
m_verbose = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneCodeGeneratorArguments::PrintUsage() const
|
void ZoneCodeGeneratorArguments::PrintUsage() const
|
||||||
@@ -166,7 +165,10 @@ bool ZoneCodeGeneratorArguments::ParseArgs(const int argc, const char** argv, bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -v; --verbose
|
// -v; --verbose
|
||||||
m_verbose = m_argument_parser.IsOptionSpecified(OPTION_VERBOSE);
|
if (m_argument_parser.IsOptionSpecified(OPTION_VERBOSE))
|
||||||
|
con::globalLogLevel = con::LogLevel::DEBUG;
|
||||||
|
else
|
||||||
|
con::globalLogLevel = con::LogLevel::INFO;
|
||||||
|
|
||||||
// -p; --print
|
// -p; --print
|
||||||
if (m_argument_parser.IsOptionSpecified(OPTION_PRINT))
|
if (m_argument_parser.IsOptionSpecified(OPTION_PRINT))
|
||||||
|
@@ -26,8 +26,6 @@ public:
|
|||||||
[[nodiscard]] bool ShouldGenerate() const;
|
[[nodiscard]] bool ShouldGenerate() const;
|
||||||
[[nodiscard]] bool ShouldPrint() const;
|
[[nodiscard]] bool ShouldPrint() const;
|
||||||
|
|
||||||
bool m_verbose;
|
|
||||||
|
|
||||||
std::vector<std::string> m_header_paths;
|
std::vector<std::string> m_header_paths;
|
||||||
std::vector<std::string> m_command_paths;
|
std::vector<std::string> m_command_paths;
|
||||||
std::string m_output_directory;
|
std::string m_output_directory;
|
||||||
|
Reference in New Issue
Block a user