From 421d6580dcaef078af88e1988d3f3570eee17241 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Fri, 18 Apr 2025 15:27:32 +0300 Subject: [PATCH] It is now possible to specify exact log level using new -l option; Adding debug logs for artefacts sources resolving --- artefact.inc.php | 2 ++ internal.inc.php | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/artefact.inc.php b/artefact.inc.php index ce6a700..6571089 100644 --- a/artefact.inc.php +++ b/artefact.inc.php @@ -43,6 +43,7 @@ class TaskmanArtefact if(isset($this->sources_fn[$idx])) { $fn = $this->sources_fn[$idx]; + \taskman\log(2, "Task '{$this->task->getName()}' artefact '{$this->path}' resolving sources at $idx\n"); $sources = $fn(); $this->sources[$idx] = $sources; return $sources; @@ -69,6 +70,7 @@ class TaskmanArtefact if(isset($this->sources_changed_fn[$idx])) { $fn = $this->sources_changed_fn[$idx]; + \taskman\log(2, "Task '{$this->task->getName()}' artefact '{$this->path}' resolving changed sources at $idx\n"); $changed = $fn(); $this->sources_changed[$idx] = $changed; return $changed; diff --git a/internal.inc.php b/internal.inc.php index 8d8cf4d..c651dc5 100644 --- a/internal.inc.php +++ b/internal.inc.php @@ -202,6 +202,14 @@ function _process_argv(array &$argv) { $TASKMAN_LOG_LEVEL = -1; } + else if($v == '-l') + { + if(!isset($argv[$i+1])) + throw new \taskman\TaskmanException("Log level is missing"); + + $TASKMAN_LOG_LEVEL = intval($argv[$i+1]); + ++$i; + } else if($v == '-O') { $TASKMAN_NO_DEPS = true;