It is now possible to specify exact log level using new -l option; Adding debug logs for artefacts sources resolving
Publish PHP Package / docker (push) Successful in 6s Details

This commit is contained in:
Pavel Shevaev 2025-04-18 15:27:32 +03:00
parent dbf30f1231
commit 421d6580dc
2 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,7 @@ class TaskmanArtefact
if(isset($this->sources_fn[$idx])) if(isset($this->sources_fn[$idx]))
{ {
$fn = $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(); $sources = $fn();
$this->sources[$idx] = $sources; $this->sources[$idx] = $sources;
return $sources; return $sources;
@ -69,6 +70,7 @@ class TaskmanArtefact
if(isset($this->sources_changed_fn[$idx])) if(isset($this->sources_changed_fn[$idx]))
{ {
$fn = $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(); $changed = $fn();
$this->sources_changed[$idx] = $changed; $this->sources_changed[$idx] = $changed;
return $changed; return $changed;

View File

@ -202,6 +202,14 @@ function _process_argv(array &$argv)
{ {
$TASKMAN_LOG_LEVEL = -1; $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') else if($v == '-O')
{ {
$TASKMAN_NO_DEPS = true; $TASKMAN_NO_DEPS = true;