log-parser: move the kata-log-parser from the tests repo

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>
This commit is contained in:
Snir Sheriber
2022-04-27 16:53:25 +03:00
parent 61a167139c
commit c7dacb1211
514 changed files with 296989 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
//
// Copyright (c) 2018 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package main
import (
"encoding/json"
"os"
)
type displayJSON struct {
}
func (d *displayJSON) Display(entries *LogEntries, fieldNames []string, file *os.File) error {
encoder := json.NewEncoder(file)
encoder.SetIndent(displayPrefix, displayIndentValue)
return encoder.Encode(entries)
}