Initial README (#120)

* initial readme + logging and output fixes to support descriptions

* minor tweaks to README descriptions

* simplify phrasing

Co-authored-by: Alfredo Deza <adeza@anchore.com>

* add comment for example gif

Co-authored-by: Alfredo Deza <adeza@anchore.com>

* spelling fix

Co-authored-by: Alfredo Deza <adeza@anchore.com>

* update phrasing

Co-authored-by: Alfredo Deza <adeza@anchore.com>

* simplify TODO note

Co-authored-by: Alfredo Deza <adeza@anchore.com>

* grammar fix

Co-authored-by: Alfredo Deza <adeza@anchore.com>

* phrase fix

Co-authored-by: Alfredo Deza <adeza@anchore.com>

* rm readme bash block indicators

* clarify config examples are default values

* rm value

Co-authored-by: Alfredo Deza <adeza@anchore.com>

Co-authored-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
Alex Goodman
2020-08-04 15:22:34 -04:00
committed by GitHub
co-authored by Alfredo Deza
parent 8fe59c6f1a
commit 2560266e38
6 changed files with 108 additions and 7 deletions
+2
View File
@@ -21,6 +21,7 @@ type LogrusConfig struct {
type LogrusLogger struct {
Config LogrusConfig
Logger *logrus.Logger
Output io.Writer
}
type LogrusNestedLogger struct {
@@ -71,6 +72,7 @@ func NewLogrusLogger(cfg LogrusConfig) *LogrusLogger {
return &LogrusLogger{
Config: cfg,
Logger: appLogger,
Output: output,
}
}
+12 -2
View File
@@ -61,7 +61,12 @@ func OutputToEphemeralTUI(workerErrs <-chan error, subscription *partybus.Subscr
fr.Close()
frame.Close()
// flush any errors to the screen before the report
fmt.Fprint(output, logBuffer.String())
logWrapper, ok := log.Log.(*logger.LogrusLogger)
if ok {
fmt.Fprint(logWrapper.Output, logBuffer.String())
} else {
fmt.Fprint(output, logBuffer.String())
}
}
logWrapper, ok := log.Log.(*logger.LogrusLogger)
if ok {
@@ -107,7 +112,12 @@ eventLoop:
isClosed = true
// flush any errors to the screen before the report
fmt.Fprint(output, logBuffer.String())
logWrapper, ok := log.Log.(*logger.LogrusLogger)
if ok {
fmt.Fprint(logWrapper.Output, logBuffer.String())
} else {
fmt.Fprint(output, logBuffer.String())
}
if err := common.CatalogerFinishedHandler(e); err != nil {
log.Errorf("unable to show %s event: %+v", e.Type, err)