aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-build-force.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-07-20 21:19:36 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-07-20 21:19:36 +0300
commit58e98949ad3dc27b8261688b99f920d106724252 (patch)
treebcdbe7bf4ad102fd532e266bb838548087a85dd2 /mod/mod-build-force.cxx
parentea6808cc41094b87f667705587fe2deea0437a1e (diff)
Log more info when issue warnings in build-result and build-force handlers
Diffstat (limited to 'mod/mod-build-force.cxx')
-rw-r--r--mod/mod-build-force.cxx29
1 files changed, 21 insertions, 8 deletions
diff --git a/mod/mod-build-force.cxx b/mod/mod-build-force.cxx
index af4b8e9..04e1883 100644
--- a/mod/mod-build-force.cxx
+++ b/mod/mod-build-force.cxx
@@ -188,16 +188,29 @@ handle (request& rq, response& rs)
if (b->force != force)
{
+ // Log the force rebuild with the warning severity, truncating the
+ // reason if too long.
+ //
+ diag_record dr (warn);
+ dr << "force rebuild for ";
+
+ if (!b->tenant.empty ())
+ dr << b->tenant << ' ';
+
+ dr << b->package_name << '/' << b->package_version << ' '
+ << b->target_config_name << '/' << b->target << ' '
+ << b->package_config_name << ' '
+ << b->toolchain_name << '-' << b->toolchain_version
+ << " (state: " << to_string (b->state) << ' ' << to_string (b->force)
+ << "): ";
+
+ if (reason.size () < 50)
+ dr << reason;
+ else
+ dr << string (reason, 0, 50) << "...";
+
b->force = force;
build_db_->update (b);
-
- l1 ([&]{trace << "force rebuild for "
- << b->tenant << ' '
- << b->package_name << '/' << b->package_version << ' '
- << b->target_config_name << '/' << b->target << ' '
- << b->package_config_name << ' '
- << b->toolchain_name << '-' << b->toolchain_version
- << ": " << reason;});
}
t.commit ();