ues trace

For a complicated workflow, if you need to trace and pin point a step, you can use trace cmd. This introduces trace to set a colorful trace marker to easily locate problem in verbose log

Please note that the display of trace is colored in terminal output

Demo

source

Main task yaml file
    vars:
      tom: this is tom in global
      jerry: this is jerry in global
    tasks:
    - name: task
      task:
      - func: call
        do: sub
      - func: cmd
        desc: check value of tom
        do:
        - name: print
          cmd: 'in main task print3: {{.tom}}'
    - name: sub
      task:
      - func: cmd
        desc: check value of tom 1
        vars:
          john: john in sub func1
        do:
        - name: reg
          cmd:
            name: tom
            desc: by default tom is registered in to global context
            value: 'tom created in sub'
        - name: print
          cmd: 'in sub print1: {{.tom}}'
      - func: cmd
        do:
        - name: trace
          cmd: debug tom's value==>
      - func: cmd
        desc: check value of tom 2
        vars:
          john: john in sub func2
        do:
        - name: print
          cmd: 'in sub print2: {{.tom}}'
      - func: cmd
        do:
        - name: trace
          cmd: <==debug tom's value
    
Main log file
    loading [Config]:  ./tests/functests/upconfig.yml
    Main config:
                 Version -> 1.0.0
                  RefDir -> ./tests/functests
                 WorkDir -> cwd
              AbsWorkDir -> /up_project/up
                TaskFile -> c0107
                 Verbose -> vvv
              ModuleName -> self
               ShellType -> /bin/sh
           MaxCallLayers -> 8
                 Timeout -> 3600000
     MaxModuelCallLayers -> 256
               EntryTask -> task
      ModRepoUsernameRef -> 
      ModRepoPasswordRef -> 
    work dir: /up_project/up
    -exec task: task
    loading [Task]:  ./tests/functests/c0107
    module: [self], instance id: [dev], exec profile: []
    profile -  envVars:
    
    (*core.Cache)({
    })
    
    Task1: [task ==> task:  ]
    -Step1:
    self: final context exec vars:
    
    (*core.Cache)({
      "jerry": "this is jerry in global",
      "up_runtime_task_layer_number": 0,
      "tom": "this is tom in global"
    })
    
    =Task2: [task ==> sub:  ]
    --Step1: [: check value of tom 1 ]
    self: final context exec vars:
    
    (*core.Cache)({
      "john": "john in sub func1",
      "tom": "this is tom in global",
      "jerry": "this is jerry in global",
      "up_runtime_task_layer_number": 1
    })
    
    ~~SubStep1: [reg:  ]
    ~~SubStep2: [print:  ]
    in sub print1: tom created in sub
    --Step2:
    self: final context exec vars:
    
    (*core.Cache)({
      "tom": "tom created in sub",
      "jerry": "this is jerry in global",
      "up_runtime_task_layer_number": 1
    })
    
    ~~SubStep1: [trace:  ]
    Trace:debug tom's value==>
    --Step3: [: check value of tom 2 ]
    self: final context exec vars:
    
    (*core.Cache)({
      "up_runtime_task_layer_number": 1,
      "tom": "tom created in sub",
      "john": "john in sub func2",
      "jerry": "this is jerry in global"
    })
    
    ~~SubStep1: [print:  ]
    in sub print2: tom created in sub
    --Step4:
    self: final context exec vars:
    
    (*core.Cache)({
      "tom": "tom created in sub",
      "jerry": "this is jerry in global",
      "up_runtime_task_layer_number": 1
    })
    
    ~~SubStep1: [trace:  ]
    Trace:<==debug tom's value
    -Step2: [: check value of tom ]
    self: final context exec vars:
    
    (*core.Cache)({
      "jerry": "this is jerry in global",
      "up_runtime_task_layer_number": 1,
      "tom": "this is tom in global"
    })
    
    ~SubStep1: [print:  ]
    in main task print3: this is tom in global
    
Logs with different verbose level
Raw logs with different verbose level