github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/core/management/debug_doc.yaml (about)

     1  - DocumentID: debug
     2    Title: >+
     3      `debug`
     4    CategoryID: commands
     5    Summary: >-
     6      Debugging information
     7    Description: |-
     8      `debug` has two modes: as a function and as a method.
     9  
    10      ### Debug Method
    11  
    12      This usage will return debug information about the previous function ran.
    13  
    14      ### Debug Function:
    15  
    16      This will enable or disable debugging mode.
    17  
    18    Usage: |-
    19      **Enable or disable debug output:**
    20  
    21      ```
    22      debug boolean -> <stdout>
    23      ```
    24  
    25      **Output whether debug mode is enabled or disabled:**
    26      
    27      ```
    28      debug -> <stdout>
    29      ```
    30  
    31      **Run a pipeline with debug mode enabled:**
    32  
    33      ```
    34      debug { code-block } -> <stdout>
    35      ```
    36  
    37      **Print debugging information about the previous command:**
    38  
    39      ```
    40      <stdin> -> debug -> <stdout>
    41      ```
    42  
    43    Examples: |-
    44      **Running a code block with debugging:**
    45  
    46      ```
    47      » debug
    48      false
    49  
    50      » debug { out "debug mode is now ${debug}" }
    51      debug mode is now true
    52  
    53      » debug
    54      false
    55      ```
    56  
    57      **Return debugging information on the previous function:**
    58  
    59      ```
    60      » out "hello, world!" -> debug 
    61      {
    62          "DataType": {
    63              "Go": "[]string",
    64              "Murex": "str"
    65          },
    66          "Process": {
    67              "Context": {
    68                  "Context": 0
    69              },
    70              "Stdin": {},
    71              "Stdout": {},
    72              "Stderr": {},
    73              "Parameters": {
    74                  "Params": [
    75                      "hello, world!"
    76                  ],
    77                  "Tokens": [
    78                      [
    79                          {
    80                              "Type": 0,
    81                              "Key": ""
    82                          }
    83                      ],
    84                      [
    85                          {
    86                              "Type": 1,
    87                              "Key": "hello, world!"
    88                          }
    89                      ],
    90                      [
    91                          {
    92                              "Type": 0,
    93                              "Key": ""
    94                          }
    95                      ]
    96                  ]
    97              },
    98              "ExitNum": 0,
    99              "Name": "echo",
   100              "Id": 3750,
   101              "Exec": {
   102                  "Pid": 0,
   103                  "Cmd": null,
   104                  "PipeR": null,
   105                  "PipeW": null
   106              },
   107              "PromptGoProc": 1,
   108              "Path": "",
   109              "IsMethod": false,
   110              "IsNot": false,
   111              "NamedPipeOut": "out",
   112              "NamedPipeErr": "err",
   113              "NamedPipeTest": "",
   114              "State": 7,
   115              "IsBackground": false,
   116              "LineNumber": 1,
   117              "ColNumber": 1,
   118              "RunMode": 0,
   119              "Config": {},
   120              "Tests": {
   121                  "Results": null
   122              },
   123              "Variables": {},
   124              "FidTree": [
   125                  0,
   126                  3750
   127              ],
   128              "CreationTime": "2019-01-20T00:00:52.167127131Z",
   129              "StartTime": "2019-01-20T00:00:52.167776212Z"
   130          }
   131      }
   132      ```
   133  
   134      **Enable or disable debug mode:**
   135  
   136      ```
   137      » debug on
   138      true
   139  
   140      » debug off
   141      false
   142      ```
   143  
   144      **Output whether debug mode is enabled or disabled:**
   145      
   146      ```
   147      » debug
   148      false
   149      ```
   150    Flags:
   151    Detail: |-
   152      When enabling or disabling debug mode, because the parameter is a murex
   153      boolean type, it means you can use other boolean terms. eg
   154  
   155      ```
   156      # enable debugging
   157      » debug 1
   158      » debug on
   159      » debug yes
   160      » debug true
   161  
   162      # disable debugging
   163      » debug 0
   164      » debug off
   165      » debug no
   166      » debug false
   167      ```
   168  
   169      It is also worth noting that the debugging information needs to be written
   170      into the Go source code rather than in Murex's shell scripting language.
   171      If you require debugging those processes then please use Murex's `test`
   172      framework
   173    Synonyms:
   174    Related:
   175    - runtime
   176    - test