1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
11 "git.arvados.org/arvados.git/sdk/go/ctxlog"
12 "github.com/sirupsen/logrus"
15 var Command = &command{}
25 type NoPrefixFormatter struct{}
27 func (f *NoPrefixFormatter) Format(entry *logrus.Entry) ([]byte, error) {
28 return []byte(entry.Message), nil
31 // RunCommand implements the subcommand "costanalyzer <collection> <collection> ..."
32 func (c *command) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
34 logger := ctxlog.New(stderr, "text", "info")
37 logger.Error("\n" + err.Error() + "\n")
41 logger.SetFormatter(new(NoPrefixFormatter))
43 exitcode, err := c.costAnalyzer(prog, args, logger, stdout, stderr)