artifactoryjfrog-cli

How do I suspress "jf rt search --count" infomational messages?


When I successfully run a JFrog CLI jf rt search --count command, the count is written to stdout while informational messages are written to stderr:

$ jf rt search test --count=true --server-id=server_id --recursive=true --include-dirs=true
11:34:23 [Info] Searching artifacts...
11:34:24 [Info] Found 1 artifact.
1

How can I suppress the informational messages. Note that I can't simply redirect stderr to /dev/null as I want error messages when the jf rt search --count command fails.


Solution

  • Adjust the log level to Warning, by setting the JFROG_CLI_LOG_LEVEL environment variable:

    export JFROG_CLI_LOG_LEVEL=WARN
    

    One liner:

    JFROG_CLI_LOG_LEVEL=WARN jf rt search test --count=true --server-id=server_id --recursive=true --include-dirs=true
    

    Read more about it under the Environment Variables section in the JFrog CLI documentation.