mirror of
https://github.com/onyx-and-iris/vbantxt.git
synced 2026-04-07 17:53:30 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 09e4b107bf | |||
| c7b9d75ea1 | |||
| cc42e928e0 | |||
| 80a675cc6a | |||
| 6801d9e4e1 |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -11,6 +11,19 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass
|
|||||||
|
|
||||||
- [x]
|
- [x]
|
||||||
|
|
||||||
|
# [0.4.1] - 2025-04-05
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- `-loglevel` flag is now of type string. It accepts any one of trace, debug, info, warn, error, fatal or panic.
|
||||||
|
- It defaults to warn.
|
||||||
|
|
||||||
|
# [0.3.1] - 2025-03-31
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- The CLI now uses `os.UserConfigDir()` to load the default *config.toml*, which should respect `$XDG_CONFIG_HOME`. See [UserConfigDir](https://pkg.go.dev/os#UserConfigDir)
|
||||||
|
|
||||||
# [0.2.1] - 2024-11-07
|
# [0.2.1] - 2024-11-07
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -9,10 +9,10 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
|
|||||||
|
|
||||||
## Tested against
|
## Tested against
|
||||||
|
|
||||||
- Basic 1.0.8.4
|
- Basic 1.1.1.8
|
||||||
- Banana 2.0.6.4
|
- Banana 2.1.1.8
|
||||||
- Potato 3.0.2.4
|
- Potato 3.1.1.8
|
||||||
- Matrix 1.0.0.3
|
- Matrix 1.0.1.2
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ Command line flags will override values in a config.toml.
|
|||||||
|
|
||||||
## `Script files`
|
## `Script files`
|
||||||
|
|
||||||
The vbantxt-cli utility accepts a single string request or an array of string requests. This means you can pass scripts stored in files.
|
The vbantxt CLI accepts a single string request or an array of string requests. This means you can pass scripts stored in files.
|
||||||
|
|
||||||
For example, in Windows with Powershell you could:
|
For example, in Windows with Powershell you could:
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ vbantxt -s=streamname "Point(ASIO128.IN[2],ASIO128.OUT[1]).dBGain = -8"
|
|||||||
|
|
||||||
## `Logging`
|
## `Logging`
|
||||||
|
|
||||||
The `-log-level` flag allows you to control the verbosity of the application's logging output.
|
The `-loglevel` flag allows you to control the verbosity of the application's logging output.
|
||||||
|
|
||||||
Acceptable values for this flag are:
|
Acceptable values for this flag are:
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ Acceptable values for this flag are:
|
|||||||
For example, to set the log level to `debug`, you can use:
|
For example, to set the log level to `debug`, you can use:
|
||||||
|
|
||||||
```
|
```
|
||||||
vbantxt -s=streamname -log-level=debug "bus[0].eq.on=1 bus[1].gain=-12.8"
|
vbantxt -s=streamname -loglevel=debug "bus[0].eq.on=1 bus[1].gain=-12.8"
|
||||||
```
|
```
|
||||||
|
|
||||||
The default log level is `warn` if the flag is not specified.
|
The default log level is `warn` if the flag is not specified.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ type opts struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func exit(err error) {
|
func exit(err error) {
|
||||||
_, _ = fmt.Fprintf(os.Stderr, "Error: %s", err)
|
_, _ = fmt.Fprintf(os.Stderr, "Error: %s\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,29 +60,16 @@ func main() {
|
|||||||
defaultConfigPath := filepath.Join(configDir, "vbantxt", "config.toml")
|
defaultConfigPath := filepath.Join(configDir, "vbantxt", "config.toml")
|
||||||
flag.StringVar(&configPath, "config", defaultConfigPath, "config path")
|
flag.StringVar(&configPath, "config", defaultConfigPath, "config path")
|
||||||
flag.StringVar(&configPath, "C", defaultConfigPath, "config path (shorthand)")
|
flag.StringVar(&configPath, "C", defaultConfigPath, "config path (shorthand)")
|
||||||
flag.StringVar(&loglevel, "log-level", "warn", "log level")
|
flag.StringVar(&loglevel, "loglevel", "warn", "log level")
|
||||||
flag.StringVar(&loglevel, "l", "warn", "log level (shorthand)")
|
flag.StringVar(&loglevel, "l", "warn", "log level (shorthand)")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
switch loglevel {
|
level, err := log.ParseLevel(loglevel)
|
||||||
case "trace":
|
if err != nil {
|
||||||
log.SetLevel(log.TraceLevel)
|
|
||||||
case "debug":
|
|
||||||
log.SetLevel(log.DebugLevel)
|
|
||||||
case "info":
|
|
||||||
log.SetLevel(log.InfoLevel)
|
|
||||||
case "warn":
|
|
||||||
log.SetLevel(log.WarnLevel)
|
|
||||||
case "error":
|
|
||||||
log.SetLevel(log.ErrorLevel)
|
|
||||||
case "fatal":
|
|
||||||
log.SetLevel(log.FatalLevel)
|
|
||||||
case "panic":
|
|
||||||
log.SetLevel(log.PanicLevel)
|
|
||||||
default:
|
|
||||||
exit(fmt.Errorf("invalid log level: %s", loglevel))
|
exit(fmt.Errorf("invalid log level: %s", loglevel))
|
||||||
}
|
}
|
||||||
|
log.SetLevel(level)
|
||||||
|
|
||||||
o := opts{
|
o := opts{
|
||||||
host: host,
|
host: host,
|
||||||
|
|||||||
Reference in New Issue
Block a user