n25/pages/usage-slide.md

69 lines
No EOL
1.6 KiB
Markdown

---
level: 2
---
# Usage
`infctl` has a single, compulsory parameter `[-f|--deployment-file]` and an optional environment variable `LOG_FORMAT` which may be ["none"|"basic"|""]
there must be a valid `deployment-file`
`LOG_FORMAT` is used to switch structured log to be off, "none", 2 field with "basic" or JSON ( the default )
````md magic-move {lines: true}
```bash
export LOG_FORMAT=none
infctl
no config specified with --deployment-file=<path_to_config_file>
```
```bash
export LOG_FORMAT=none
infctl -f pipelines/dev/vagrant-k3s.json
🔄 Running step: Create Vagrant nodes
🐞 Running command: ./scripts/install_vagrant_nodes.sh
...
```
```bash
export LOG_FORMAT="basic"
infctl -f pipelines/dev/vagrant-k3s.json
level=INFO msg="Project name already exists: hdshd\n"
level=INFO msg="🔄 Running step: Create Vagrant nodes"
...
```
```bash
export LOG_FORMAT=""
infctl -f pipelines/dev/vagrant-k3s.json
{"time":"2025-08-16T18:28:00.412416282+01:00","level":"INFO","msg":"Project name already exists: hdshd\n"}
{"time":"2025-08-16T18:28:00.412511255+01:00","level":"INFO","msg":"🔄 Running step: Create Vagrant nodes"}
...
```
````
<!--
`infctl` has only one compulsory parameter
-f | --deployment-file
another, entirely optional environment variable `LOG_FORMAT` sets the degree to which output is structured
none - supresses all structured logging
basic - shows level and standard / error output
default - structures log output as JSON with date timestamp, level and message
the latter is purposed for ingesting logs into other systems that can use these fields for categorizing the data
-->