mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 20:39:41 +00:00
to the kata-containers repo under the src/tools/log-parser folder and vendor the modules Fixes: #4100 Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
33 lines
484 B
Go
33 lines
484 B
Go
//
|
|
// Copyright (c) 2018 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
yaml "gopkg.in/yaml.v2"
|
|
)
|
|
|
|
type displayYAML struct {
|
|
}
|
|
|
|
func (d *displayYAML) Display(entries *LogEntries, fieldNames []string, file *os.File) error {
|
|
bytes, err := yaml.Marshal(entries)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if err = addCommentHeader(fieldNames, file); err != nil {
|
|
return err
|
|
}
|
|
|
|
_, err = fmt.Fprintln(file, string(bytes))
|
|
|
|
return err
|
|
}
|