mirror of
https://github.com/ModOrganizer2/mob.git
synced 2026-07-27 14:07:05 -07:00
adjusted some log levels
This commit is contained in:
+1
-1
@@ -233,7 +233,7 @@ std::string context::make_log_string(reason r, level, std::string_view s) const
|
||||
if (s.empty())
|
||||
oss << "interrupted";
|
||||
else
|
||||
oss << s << " (interrupted)";
|
||||
oss << s;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
+9
-9
@@ -19,7 +19,7 @@ void check(const context& cx, const fs::path& p);
|
||||
|
||||
void touch(const context& cx, const fs::path& p)
|
||||
{
|
||||
cx.debug(context::fs, "touching " + p.string());
|
||||
cx.trace(context::fs, "touching " + p.string());
|
||||
check(cx, p);
|
||||
|
||||
if (!conf::dry())
|
||||
@@ -28,7 +28,7 @@ void touch(const context& cx, const fs::path& p)
|
||||
|
||||
void create_directories(const context& cx, const fs::path& p)
|
||||
{
|
||||
cx.debug(context::fs, "creating dir " + p.string());
|
||||
cx.trace(context::fs, "creating dir " + p.string());
|
||||
check(cx, p);
|
||||
|
||||
if (!conf::dry())
|
||||
@@ -37,7 +37,7 @@ void create_directories(const context& cx, const fs::path& p)
|
||||
|
||||
void delete_directory(const context& cx, const fs::path& p, flags f)
|
||||
{
|
||||
cx.debug(context::fs, "deleting dir " + p.string());
|
||||
cx.trace(context::fs, "deleting dir " + p.string());
|
||||
check(cx, p);
|
||||
|
||||
if (!fs::exists(p))
|
||||
@@ -63,7 +63,7 @@ void delete_directory(const context& cx, const fs::path& p, flags f)
|
||||
|
||||
void delete_file(const context& cx, const fs::path& p, flags f)
|
||||
{
|
||||
cx.debug(context::fs, "deleting file " + p.string());
|
||||
cx.trace(context::fs, "deleting file " + p.string());
|
||||
check(cx, p);
|
||||
|
||||
if (!fs::exists(p))
|
||||
@@ -92,7 +92,7 @@ void delete_file(const context& cx, const fs::path& p, flags f)
|
||||
|
||||
void remove_readonly(const context& cx, const fs::path& first)
|
||||
{
|
||||
cx.debug(context::fs, "removing read-only from " + first.string());
|
||||
cx.trace(context::fs, "removing read-only from " + first.string());
|
||||
check(cx, first);
|
||||
|
||||
if (!conf::dry())
|
||||
@@ -194,7 +194,7 @@ void rename(const context& cx, const fs::path& src, const fs::path& dest)
|
||||
"already exists");
|
||||
}
|
||||
|
||||
cx.debug(context::fs, "renaming " + src.string() + " to " + dest.string());
|
||||
cx.trace(context::fs, "renaming " + src.string() + " to " + dest.string());
|
||||
do_rename(cx, src, dest);
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ void move_to_directory(
|
||||
src.filename().string() + " already exists");
|
||||
}
|
||||
|
||||
cx.debug(context::fs, "moving " + src.string() + " to " + target.string());
|
||||
cx.trace(context::fs, "moving " + src.string() + " to " + target.string());
|
||||
do_rename(cx, src, target);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ void copy_file_to_dir_if_better(
|
||||
const auto target = dir / file.filename();
|
||||
if (is_source_better(cx, file, target))
|
||||
{
|
||||
cx.debug(context::fs, file.string() + " -> " + dir.string());
|
||||
cx.trace(context::fs, file.string() + " -> " + dir.string());
|
||||
|
||||
if (!conf::dry())
|
||||
do_copy_file_to_dir(cx, file, dir);
|
||||
@@ -310,7 +310,7 @@ void do_delete_directory(const context& cx, const fs::path& p)
|
||||
{
|
||||
if (ec.value() == ERROR_ACCESS_DENIED)
|
||||
{
|
||||
cx.debug(
|
||||
cx.trace(
|
||||
context::fs,
|
||||
"got access denied trying to delete dir " + p.string() + ", "
|
||||
"trying to remove read-only flag recursively");
|
||||
|
||||
+10
-4
@@ -413,7 +413,7 @@ void process::join()
|
||||
|
||||
GetExitCodeProcess(impl_.handle.get(), &code_);
|
||||
|
||||
cx_->debug(context::cmd,
|
||||
cx_->trace(context::cmd,
|
||||
"process completed, exit code " + std::to_string(code_));
|
||||
|
||||
if (impl_.interrupt)
|
||||
@@ -423,7 +423,7 @@ void process::join()
|
||||
{
|
||||
if (flags_ & allow_failure)
|
||||
{
|
||||
cx_->debug(context::cmd,
|
||||
cx_->trace(context::cmd,
|
||||
"process failed but failure was allowed");
|
||||
}
|
||||
else
|
||||
@@ -532,10 +532,16 @@ int process::exit_code() const
|
||||
|
||||
void process::add_arg(const std::string& k, const std::string& v, arg_flags f)
|
||||
{
|
||||
if ((f & verbose) && !conf::log_trace())
|
||||
if ((f & log_debug) && !conf::log_debug())
|
||||
return;
|
||||
|
||||
if ((f & quiet) && conf::log_trace())
|
||||
if ((f & log_trace) && !conf::log_trace())
|
||||
return;
|
||||
|
||||
if ((f & log_dump) && !conf::log_dump())
|
||||
return;
|
||||
|
||||
if ((f & log_quiet) && conf::log_trace())
|
||||
return;
|
||||
|
||||
if (k.empty() && v.empty())
|
||||
|
||||
+6
-4
@@ -47,10 +47,12 @@ public:
|
||||
enum arg_flags
|
||||
{
|
||||
noargflags = 0x00,
|
||||
verbose = 0x01,
|
||||
quiet = 0x02,
|
||||
nospace = 0x04,
|
||||
quote = 0x08
|
||||
log_debug = 0x01,
|
||||
log_trace = 0x02,
|
||||
log_dump = 0x04,
|
||||
log_quiet = 0x08,
|
||||
nospace = 0x10,
|
||||
quote = 0x20
|
||||
};
|
||||
|
||||
struct filter
|
||||
|
||||
+2
-2
@@ -66,8 +66,8 @@ void cmake::do_run()
|
||||
process_
|
||||
.arg("-G", "\"" + g.name + "\"")
|
||||
.arg("-DCMAKE_BUILD_TYPE=Release")
|
||||
.arg("-DCMAKE_INSTALL_MESSAGE=NEVER", process::quiet)
|
||||
.arg("--log-level", "WARNING", process::quiet)
|
||||
.arg("-DCMAKE_INSTALL_MESSAGE=NEVER", process::log_quiet)
|
||||
.arg("--log-level", "WARNING", process::log_quiet)
|
||||
.arg(g.get_arch(arch_));
|
||||
|
||||
if (!prefix_.empty())
|
||||
|
||||
@@ -69,7 +69,7 @@ void downloader::do_run()
|
||||
{
|
||||
const fs::path file = path_for_url(u);
|
||||
|
||||
cx_->debug(context::net,
|
||||
cx_->trace(context::net,
|
||||
"trying " + u.string() + " into " + file.string());
|
||||
|
||||
dl_->start(u, file);
|
||||
|
||||
+3
-3
@@ -55,8 +55,8 @@ void git_clone::clone()
|
||||
.arg("--recurse-submodules")
|
||||
.arg("--depth", "1")
|
||||
.arg("--branch", branch_)
|
||||
.arg("--quiet", process::quiet)
|
||||
.arg("-c", "advice.detachedHead=false", process::quiet)
|
||||
.arg("--quiet", process::log_quiet)
|
||||
.arg("-c", "advice.detachedHead=false", process::log_quiet)
|
||||
.arg(url_)
|
||||
.arg(where_);
|
||||
|
||||
@@ -69,7 +69,7 @@ void git_clone::pull()
|
||||
.binary(third_party::git())
|
||||
.arg("pull")
|
||||
.arg("--recurse-submodules")
|
||||
.arg("--quiet", process::quiet)
|
||||
.arg("--quiet", process::log_quiet)
|
||||
.arg(url_)
|
||||
.arg(branch_)
|
||||
.cwd(where_);
|
||||
|
||||
+6
-2
@@ -60,8 +60,12 @@ void jom::do_run()
|
||||
if (f.line.find("empower your cores") != std::string::npos)
|
||||
f.lv = context::level::trace;
|
||||
})
|
||||
.arg("/C", process::quiet)
|
||||
.arg("/S", process::quiet)
|
||||
.arg("/C", process::log_quiet)
|
||||
.arg("/S", process::log_quiet)
|
||||
.arg("/L", process::log_quiet)
|
||||
.arg("/D", process::log_dump)
|
||||
.arg("/P", process::log_dump)
|
||||
.arg("/W", process::log_dump)
|
||||
.arg("/K");
|
||||
|
||||
if (flags_ & single_job)
|
||||
|
||||
@@ -87,8 +87,8 @@ void msbuild::do_run()
|
||||
.arg("-property:PlatformToolset=" + toolset)
|
||||
.arg("-property:WindowsTargetPlatformVersion=" + versions::sdk())
|
||||
.arg("-property:Platform=", plat, process::quote)
|
||||
.arg("-verbosity:minimal", process::quiet)
|
||||
.arg("-consoleLoggerParameters:ErrorsOnly", process::quiet);
|
||||
.arg("-verbosity:minimal", process::log_quiet)
|
||||
.arg("-consoleLoggerParameters:ErrorsOnly", process::log_quiet);
|
||||
|
||||
if (!projects_.empty())
|
||||
process_.arg("-target:" + mob::join(projects_, ","));
|
||||
|
||||
@@ -90,7 +90,7 @@ void patcher::do_patch(const fs::path& patch_file)
|
||||
.arg("--read-only", "ignore")
|
||||
.arg("--strip", "0")
|
||||
.arg("--directory", output_)
|
||||
.arg("--quiet", process::quiet);
|
||||
.arg("--quiet", process::log_quiet);
|
||||
|
||||
const auto check = process(base)
|
||||
.flags(process::allow_failure)
|
||||
|
||||
Reference in New Issue
Block a user