diff --git a/Dockerfile b/Dockerfile index 94ccff0032..e28bfe211b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,4 @@ USER 65532:65532 COPY --chown=65532:65532 --chmod=0700 "build/zarf-linux-$TARGETARCH" /zarf -CMD ["/zarf", "internal", "agent", "--log-level=debug", "--log-format=console-no-color", "--no-log-file"] +CMD ["/zarf", "internal", "agent", "--log-level=debug", "--log-format=console", "--no-color"] diff --git a/site/src/content/docs/commands/zarf.md b/site/src/content/docs/commands/zarf.md index 851c039c6e..c52eb45b30 100644 --- a/site/src/content/docs/commands/zarf.md +++ b/site/src/content/docs/commands/zarf.md @@ -25,7 +25,7 @@ zarf COMMAND [flags] -a, --architecture string Architecture for OCI images and Zarf packages -h, --help help for zarf --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_completion.md b/site/src/content/docs/commands/zarf_completion.md index dfccd992f8..6e52612765 100644 --- a/site/src/content/docs/commands/zarf_completion.md +++ b/site/src/content/docs/commands/zarf_completion.md @@ -27,7 +27,7 @@ See each sub-command's help for details on how to use the generated script. ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_completion_bash.md b/site/src/content/docs/commands/zarf_completion_bash.md index 3d61956468..eb5368ee81 100644 --- a/site/src/content/docs/commands/zarf_completion_bash.md +++ b/site/src/content/docs/commands/zarf_completion_bash.md @@ -50,7 +50,7 @@ zarf completion bash ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_completion_fish.md b/site/src/content/docs/commands/zarf_completion_fish.md index b988dd9cb2..710b7f208e 100644 --- a/site/src/content/docs/commands/zarf_completion_fish.md +++ b/site/src/content/docs/commands/zarf_completion_fish.md @@ -41,7 +41,7 @@ zarf completion fish [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_completion_powershell.md b/site/src/content/docs/commands/zarf_completion_powershell.md index c6f022d06a..4e67768a97 100644 --- a/site/src/content/docs/commands/zarf_completion_powershell.md +++ b/site/src/content/docs/commands/zarf_completion_powershell.md @@ -38,7 +38,7 @@ zarf completion powershell [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_completion_zsh.md b/site/src/content/docs/commands/zarf_completion_zsh.md index 64da6e2dfe..9b55c45ca5 100644 --- a/site/src/content/docs/commands/zarf_completion_zsh.md +++ b/site/src/content/docs/commands/zarf_completion_zsh.md @@ -52,7 +52,7 @@ zarf completion zsh [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_connect.md b/site/src/content/docs/commands/zarf_connect.md index 054ac1b136..d19b5b8884 100644 --- a/site/src/content/docs/commands/zarf_connect.md +++ b/site/src/content/docs/commands/zarf_connect.md @@ -41,7 +41,7 @@ zarf connect { REGISTRY | GIT | connect-name } [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_connect_list.md b/site/src/content/docs/commands/zarf_connect_list.md index 519d147268..18ecb7c294 100644 --- a/site/src/content/docs/commands/zarf_connect_list.md +++ b/site/src/content/docs/commands/zarf_connect_list.md @@ -25,7 +25,7 @@ zarf connect list [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_destroy.md b/site/src/content/docs/commands/zarf_destroy.md index 0f8b0afcb2..050ab4df3d 100644 --- a/site/src/content/docs/commands/zarf_destroy.md +++ b/site/src/content/docs/commands/zarf_destroy.md @@ -37,7 +37,7 @@ zarf destroy --confirm [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_dev.md b/site/src/content/docs/commands/zarf_dev.md index 8482860146..85252cbe1f 100644 --- a/site/src/content/docs/commands/zarf_dev.md +++ b/site/src/content/docs/commands/zarf_dev.md @@ -21,7 +21,7 @@ Commands useful for developing packages ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_dev_deploy.md b/site/src/content/docs/commands/zarf_dev_deploy.md index 148c54e1c5..1a028a4661 100644 --- a/site/src/content/docs/commands/zarf_dev_deploy.md +++ b/site/src/content/docs/commands/zarf_dev_deploy.md @@ -38,7 +38,7 @@ zarf dev deploy [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_dev_find-images.md b/site/src/content/docs/commands/zarf_dev_find-images.md index 6280b1aea9..4843e2fee3 100644 --- a/site/src/content/docs/commands/zarf_dev_find-images.md +++ b/site/src/content/docs/commands/zarf_dev_find-images.md @@ -39,7 +39,7 @@ zarf dev find-images [ DIRECTORY ] [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_dev_generate-config.md b/site/src/content/docs/commands/zarf_dev_generate-config.md index 0e8eb24c7e..e6b36e3516 100644 --- a/site/src/content/docs/commands/zarf_dev_generate-config.md +++ b/site/src/content/docs/commands/zarf_dev_generate-config.md @@ -34,7 +34,7 @@ zarf dev generate-config [ FILENAME ] [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_dev_generate.md b/site/src/content/docs/commands/zarf_dev_generate.md index 07d40407e7..6cca348c3e 100644 --- a/site/src/content/docs/commands/zarf_dev_generate.md +++ b/site/src/content/docs/commands/zarf_dev_generate.md @@ -36,7 +36,7 @@ zarf dev generate podinfo --url https://github.com/stefanprodan/podinfo.git --ve ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_dev_lint.md b/site/src/content/docs/commands/zarf_dev_lint.md index 3b2578269d..58ba89945c 100644 --- a/site/src/content/docs/commands/zarf_dev_lint.md +++ b/site/src/content/docs/commands/zarf_dev_lint.md @@ -31,7 +31,7 @@ zarf dev lint [ DIRECTORY ] [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_dev_patch-git.md b/site/src/content/docs/commands/zarf_dev_patch-git.md index 9353aa256d..b14e572e0e 100644 --- a/site/src/content/docs/commands/zarf_dev_patch-git.md +++ b/site/src/content/docs/commands/zarf_dev_patch-git.md @@ -27,7 +27,7 @@ zarf dev patch-git HOST FILE [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_dev_sha256sum.md b/site/src/content/docs/commands/zarf_dev_sha256sum.md index d964f49e8e..9293a27113 100644 --- a/site/src/content/docs/commands/zarf_dev_sha256sum.md +++ b/site/src/content/docs/commands/zarf_dev_sha256sum.md @@ -26,7 +26,7 @@ zarf dev sha256sum { FILE | URL } [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_init.md b/site/src/content/docs/commands/zarf_init.md index e915b331c8..20ab839662 100644 --- a/site/src/content/docs/commands/zarf_init.md +++ b/site/src/content/docs/commands/zarf_init.md @@ -86,7 +86,7 @@ $ zarf init --artifact-push-password={PASSWORD} --artifact-push-username={USERNA ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_package.md b/site/src/content/docs/commands/zarf_package.md index 65b55d7ccd..eea117b0cc 100644 --- a/site/src/content/docs/commands/zarf_package.md +++ b/site/src/content/docs/commands/zarf_package.md @@ -23,7 +23,7 @@ Zarf package commands for creating, deploying, and inspecting packages ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_package_create.md b/site/src/content/docs/commands/zarf_package_create.md index 14b6c33276..892e740323 100644 --- a/site/src/content/docs/commands/zarf_package_create.md +++ b/site/src/content/docs/commands/zarf_package_create.md @@ -44,7 +44,7 @@ zarf package create [ DIRECTORY ] [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_package_deploy.md b/site/src/content/docs/commands/zarf_package_deploy.md index 5c6b3944c1..341d7b5d07 100644 --- a/site/src/content/docs/commands/zarf_package_deploy.md +++ b/site/src/content/docs/commands/zarf_package_deploy.md @@ -39,7 +39,7 @@ zarf package deploy [ PACKAGE_SOURCE ] [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_package_inspect.md b/site/src/content/docs/commands/zarf_package_inspect.md index 5535e7fbd1..9f896f4902 100644 --- a/site/src/content/docs/commands/zarf_package_inspect.md +++ b/site/src/content/docs/commands/zarf_package_inspect.md @@ -34,7 +34,7 @@ zarf package inspect [ PACKAGE_SOURCE ] [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_package_list.md b/site/src/content/docs/commands/zarf_package_list.md index 2b932c76d5..5e554f6b3a 100644 --- a/site/src/content/docs/commands/zarf_package_list.md +++ b/site/src/content/docs/commands/zarf_package_list.md @@ -26,7 +26,7 @@ zarf package list [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_package_mirror-resources.md b/site/src/content/docs/commands/zarf_package_mirror-resources.md index 090e7502e1..72c07be02c 100644 --- a/site/src/content/docs/commands/zarf_package_mirror-resources.md +++ b/site/src/content/docs/commands/zarf_package_mirror-resources.md @@ -67,7 +67,7 @@ $ zarf package mirror-resources \ -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_package_publish.md b/site/src/content/docs/commands/zarf_package_publish.md index 4d921da448..705ea1b0ab 100644 --- a/site/src/content/docs/commands/zarf_package_publish.md +++ b/site/src/content/docs/commands/zarf_package_publish.md @@ -41,7 +41,7 @@ $ zarf package publish ./path/to/dir oci://my-registry.com/my-namespace -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_package_pull.md b/site/src/content/docs/commands/zarf_package_pull.md index bdc4dbf8ba..44830762b5 100644 --- a/site/src/content/docs/commands/zarf_package_pull.md +++ b/site/src/content/docs/commands/zarf_package_pull.md @@ -42,7 +42,7 @@ $ zarf package pull oci://ghcr.io/defenseunicorns/packages/dos-games:1.0.0 -a sk -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_package_remove.md b/site/src/content/docs/commands/zarf_package_remove.md index b5f07601de..a294fd0e73 100644 --- a/site/src/content/docs/commands/zarf_package_remove.md +++ b/site/src/content/docs/commands/zarf_package_remove.md @@ -29,7 +29,7 @@ zarf package remove { PACKAGE_SOURCE | PACKAGE_NAME } --confirm [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools.md b/site/src/content/docs/commands/zarf_tools.md index 30b2c219c9..9f55363d32 100644 --- a/site/src/content/docs/commands/zarf_tools.md +++ b/site/src/content/docs/commands/zarf_tools.md @@ -21,7 +21,7 @@ Collection of additional tools to make airgap easier ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools_archiver.md b/site/src/content/docs/commands/zarf_tools_archiver.md index 22516a9e55..d4596a9954 100644 --- a/site/src/content/docs/commands/zarf_tools_archiver.md +++ b/site/src/content/docs/commands/zarf_tools_archiver.md @@ -21,7 +21,7 @@ Compresses/Decompresses generic archives, including Zarf packages ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools_archiver_compress.md b/site/src/content/docs/commands/zarf_tools_archiver_compress.md index b0bb13f98c..07e98fe0d3 100644 --- a/site/src/content/docs/commands/zarf_tools_archiver_compress.md +++ b/site/src/content/docs/commands/zarf_tools_archiver_compress.md @@ -25,7 +25,7 @@ zarf tools archiver compress SOURCES ARCHIVE [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools_archiver_decompress.md b/site/src/content/docs/commands/zarf_tools_archiver_decompress.md index 762cf41171..a493056c40 100644 --- a/site/src/content/docs/commands/zarf_tools_archiver_decompress.md +++ b/site/src/content/docs/commands/zarf_tools_archiver_decompress.md @@ -26,7 +26,7 @@ zarf tools archiver decompress ARCHIVE DESTINATION [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools_archiver_version.md b/site/src/content/docs/commands/zarf_tools_archiver_version.md index 8cf1c293aa..5c7a02df98 100644 --- a/site/src/content/docs/commands/zarf_tools_archiver_version.md +++ b/site/src/content/docs/commands/zarf_tools_archiver_version.md @@ -25,7 +25,7 @@ zarf tools archiver version [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools_clear-cache.md b/site/src/content/docs/commands/zarf_tools_clear-cache.md index 49db596625..e8e0dc97d5 100644 --- a/site/src/content/docs/commands/zarf_tools_clear-cache.md +++ b/site/src/content/docs/commands/zarf_tools_clear-cache.md @@ -26,7 +26,7 @@ zarf tools clear-cache [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools_download-init.md b/site/src/content/docs/commands/zarf_tools_download-init.md index 2b1889d35d..8b71da2d4c 100644 --- a/site/src/content/docs/commands/zarf_tools_download-init.md +++ b/site/src/content/docs/commands/zarf_tools_download-init.md @@ -26,7 +26,7 @@ zarf tools download-init [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools_gen-key.md b/site/src/content/docs/commands/zarf_tools_gen-key.md index 679252cc31..482e47e6cf 100644 --- a/site/src/content/docs/commands/zarf_tools_gen-key.md +++ b/site/src/content/docs/commands/zarf_tools_gen-key.md @@ -25,7 +25,7 @@ zarf tools gen-key [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools_gen-pki.md b/site/src/content/docs/commands/zarf_tools_gen-pki.md index 547b039e28..6e775c8d7f 100644 --- a/site/src/content/docs/commands/zarf_tools_gen-pki.md +++ b/site/src/content/docs/commands/zarf_tools_gen-pki.md @@ -26,7 +26,7 @@ zarf tools gen-pki HOST [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools_get-creds.md b/site/src/content/docs/commands/zarf_tools_get-creds.md index 984c3cc8ef..d547e9129f 100644 --- a/site/src/content/docs/commands/zarf_tools_get-creds.md +++ b/site/src/content/docs/commands/zarf_tools_get-creds.md @@ -45,7 +45,7 @@ $ zarf tools get-creds artifact ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_tools_update-creds.md b/site/src/content/docs/commands/zarf_tools_update-creds.md index a41cdb2941..092dda8018 100644 --- a/site/src/content/docs/commands/zarf_tools_update-creds.md +++ b/site/src/content/docs/commands/zarf_tools_update-creds.md @@ -74,7 +74,7 @@ $ zarf tools update-creds artifact --artifact-push-username={USERNAME} --artifac ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/site/src/content/docs/commands/zarf_version.md b/site/src/content/docs/commands/zarf_version.md index ed946e0051..146c416b91 100644 --- a/site/src/content/docs/commands/zarf_version.md +++ b/site/src/content/docs/commands/zarf_version.md @@ -30,7 +30,7 @@ zarf version [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev' + --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev' -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") --no-color Disable colors in output --no-log-file Disable log file creation diff --git a/src/cmd/root.go b/src/cmd/root.go index 27957c6299..3d045ab177 100644 --- a/src/cmd/root.go +++ b/src/cmd/root.go @@ -86,7 +86,7 @@ func preRun(cmd *cobra.Command, _ []string) error { } // Configure logger and add it to cmd context. - l, err := setupLogger(LogLevelCLI, LogFormat) + l, err := setupLogger(LogLevelCLI, LogFormat, !NoColor) if err != nil { return err } @@ -167,7 +167,7 @@ func init() { // Logs rootCmd.PersistentFlags().StringVarP(&LogLevelCLI, "log-level", "l", v.GetString(common.VLogLevel), lang.RootCmdFlagLogLevel) - rootCmd.PersistentFlags().StringVar(&LogFormat, "log-format", v.GetString(common.VLogFormat), "[beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'console-no-color', 'dev'") + rootCmd.PersistentFlags().StringVar(&LogFormat, "log-format", v.GetString(common.VLogFormat), "[beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'") rootCmd.PersistentFlags().BoolVar(&SkipLogFile, "no-log-file", v.GetBool(common.VNoLogFile), lang.RootCmdFlagSkipLogFile) rootCmd.PersistentFlags().BoolVar(&message.NoProgress, "no-progress", v.GetBool(common.VNoProgress), lang.RootCmdFlagNoProgress) rootCmd.PersistentFlags().BoolVar(&NoColor, "no-color", v.GetBool(common.VNoColor), lang.RootCmdFlagNoColor) @@ -184,7 +184,7 @@ func init() { } // setup Logger handles creating a logger and setting it as the global default. -func setupLogger(level, format string) (*slog.Logger, error) { +func setupLogger(level, format string, color bool) (*slog.Logger, error) { // If we didn't get a level from config, fallback to "info" if level == "" { level = "info" @@ -197,11 +197,15 @@ func setupLogger(level, format string) (*slog.Logger, error) { Level: sLevel, Format: logger.Format(format), Destination: logger.DestinationDefault, + Color: logger.Color(color), } l, err := logger.New(cfg) if err != nil { return nil, err } + if !color { + pterm.DisableColor() + } logger.SetDefault(l) l.Debug("logger successfully initialized", "cfg", cfg) return l, nil diff --git a/src/pkg/logger/logger.go b/src/pkg/logger/logger.go index 35db6d5727..a125888313 100644 --- a/src/pkg/logger/logger.go +++ b/src/pkg/logger/logger.go @@ -93,8 +93,6 @@ func (f Format) ToLower() Format { } var ( - // FormatConsoleNoColor uses the standard slog TextHandler - FormatConsoleNoColor Format = "console-no-color" // FormatJSON uses the standard slog JSONHandler FormatJSON Format = "json" // FormatConsole uses console-slog to provide prettier colorful messages @@ -133,14 +131,19 @@ type Config struct { Level Format Destination + Color } +// Color is a type that represents whether or not to use color in the logger. +type Color bool + // LogValue of config func (c Config) LogValue() slog.Value { return slog.GroupValue( slog.String("level", c.Level.String()), slog.Any("format", c.Format), - slog.Any("Destination", destinationString(c.Destination)), + slog.Any("destination", destinationString(c.Destination)), + slog.Bool("color", bool(c.Color)), ) } @@ -150,6 +153,7 @@ func ConfigDefault() Config { Level: Info, Format: FormatConsole, Destination: DestinationDefault, // Stderr + Color: true, } } @@ -171,10 +175,10 @@ func New(cfg Config) (*slog.Logger, error) { var handler slog.Handler switch cfg.Format.ToLower() { - case FormatConsoleNoColor: + case FormatConsole: handler = console.NewHandler(cfg.Destination, &console.HandlerOptions{ Level: slog.Level(cfg.Level), - NoColor: true, + NoColor: !bool(cfg.Color), }) case FormatJSON: handler = slog.NewJSONHandler(cfg.Destination, &opts) @@ -187,6 +191,7 @@ func New(cfg Config) (*slog.Logger, error) { handler = devslog.NewHandler(DestinationDefault, &devslog.Options{ HandlerOptions: &opts, NewLineAfterLog: true, + NoColor: !bool(cfg.Color), }) // Use discard handler if no format provided case "", FormatNone: diff --git a/src/pkg/logger/logger_test.go b/src/pkg/logger/logger_test.go index f3faf13485..4aab4d73db 100644 --- a/src/pkg/logger/logger_test.go +++ b/src/pkg/logger/logger_test.go @@ -51,12 +51,6 @@ func Test_New(t *testing.T) { Level: Error, }, }, - { - name: "Text format is supported", - cfg: Config{ - Format: FormatConsoleNoColor, - }, - }, { name: "JSON format is supported", cfg: Config{ @@ -81,6 +75,12 @@ func Test_New(t *testing.T) { Destination: os.Stdout, }, }, + { + name: "color true is ok", + cfg: Config{ + Color: true, + }, + }, } for _, tc := range tt { t.Run(tc.name, func(t *testing.T) {