From c1b53d5669b02d5aa278272fed2bbde7f4a6f835 Mon Sep 17 00:00:00 2001 From: Octav Sandulescu Date: Wed, 23 May 2018 07:05:39 +0000 Subject: [PATCH] Remove more log bloat --- VERSION | 2 +- control.lua | 2 +- signals.lua | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/VERSION b/VERSION index 9faa1b7..c946ee6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.5 +0.1.6 diff --git a/control.lua b/control.lua index 241450c..1ceda40 100644 --- a/control.lua +++ b/control.lua @@ -129,7 +129,7 @@ end) for name, func in pairs(events) do if not defines.events[name] then - log(string.format("test-mod: ignoring handler for non-existent event %s", name)) + log(string.format("Ignoring handler for non-existent event %s", name)) else script.on_event(defines.events[name], function(e) local success, err = pcall(func, e) diff --git a/signals.lua b/signals.lua index e72a2f8..f2fa2c7 100644 --- a/signals.lua +++ b/signals.lua @@ -117,8 +117,8 @@ local function check_update_rate(sample_root) end end - log(string.format("Have %d faster update candidates, need %d to change.", - #faster_update_candidates, MAX_HISTORY_COUNT / 2 + 1)) + -- log(string.format("Have %d faster update candidates, need %d to change.", + -- #faster_update_candidates, MAX_HISTORY_COUNT / 2 + 1)) -- showing _consistent_ change... if #faster_update_candidates > MAX_HISTORY_COUNT / 2 + 1 then @@ -185,7 +185,7 @@ local function calculate_rate_of_change(signal) local update_rate = sample_root.update_rate or 300 - log(string.format("Updating %s, signal %s, update rate %d ticks", signal.title, signal.signal.name, update_rate)) + -- log(string.format("Updating %s, signal %s, update rate %d ticks", signal.title, signal.signal.name, update_rate)) local buckets = bucketize_samples(samples, update_rate) if #buckets < 3 then @@ -202,11 +202,11 @@ local function calculate_rate_of_change(signal) local change_rate = change_per_min_between_samples(buckets[i], buckets[i + 1]) local weight = #buckets - i - log(string.format("Weight %d, difference %d, duration %d, unweighted change %f/min", - weight, - buckets[i].value - buckets[i+1].value, - buckets[i+1].tick - buckets[i].tick, - change_rate)) + -- log(string.format("Weight %d, difference %d, duration %d, unweighted change %f/min", + -- weight, + -- buckets[i].value - buckets[i+1].value, + -- buckets[i+1].tick - buckets[i].tick, + -- change_rate)) sum_weighted_change_rates = sum_weighted_change_rates + weight * change_rate sum_weights = sum_weights + weight @@ -215,8 +215,8 @@ local function calculate_rate_of_change(signal) local rate_of_change = sum_weighted_change_rates / sum_weights sample_root.rate_of_change_per_min = rate_of_change - log(string.format("Final sum_weights: %d, sum_weighted_change_rates: %f. New change rate: %f/min", - sum_weights, sum_weighted_change_rates, rate_of_change)) + -- log(string.format("Final sum_weights: %d, sum_weighted_change_rates: %f. New change rate: %f/min", + -- sum_weights, sum_weighted_change_rates, rate_of_change)) end