1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
10 "git.arvados.org/arvados.git/lib/config"
11 "git.arvados.org/arvados.git/sdk/go/ctxlog"
12 "github.com/sirupsen/logrus"
19 type NoPrefixFormatter struct{}
21 func (f *NoPrefixFormatter) Format(entry *logrus.Entry) ([]byte, error) {
22 return []byte(entry.Message), nil
25 // RunCommand implements the subcommand "costanalyzer <collection> <collection> ..."
26 func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
28 logger := ctxlog.New(stderr, "text", "info")
31 logger.Error("\n" + err.Error() + "\n")
35 logger.SetFormatter(new(NoPrefixFormatter))
37 loader := config.NewLoader(stdin, logger)
38 loader.SkipLegacy = true
40 exitcode, err := costanalyzer(prog, args, loader, logger, stdout, stderr)