mirror of
https://github.com/containers/podman
synced 2024-10-20 17:23:30 +00:00
Review comments
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
88a8d9e3fa
commit
7f411cb325
|
@ -260,7 +260,7 @@ type LogsValues struct {
|
|||
Tail int64
|
||||
Timestamps bool
|
||||
Latest bool
|
||||
UseNames bool
|
||||
UseName bool
|
||||
}
|
||||
|
||||
type MountValues struct {
|
||||
|
|
|
@ -55,7 +55,7 @@ func init() {
|
|||
flags.StringVar(&logsCommand.Since, "since", "", "Show logs since TIMESTAMP")
|
||||
flags.Int64Var(&logsCommand.Tail, "tail", -1, "Output the specified number of LINES at the end of the logs. Defaults to -1, which prints all lines")
|
||||
flags.BoolVarP(&logsCommand.Timestamps, "timestamps", "t", false, "Output the timestamps in the log")
|
||||
flags.BoolVarP(&logsCommand.UseNames, "names", "n", false, "Output the container name in the log")
|
||||
flags.BoolVarP(&logsCommand.UseName, "names", "n", false, "Output the container name in the log")
|
||||
markFlagHidden(flags, "details")
|
||||
flags.SetInterspersed(false)
|
||||
|
||||
|
@ -87,7 +87,7 @@ func logsCmd(c *cliconfig.LogsValues) error {
|
|||
Since: sinceTime,
|
||||
Tail: c.Tail,
|
||||
Timestamps: c.Timestamps,
|
||||
UseNames: c.UseNames,
|
||||
UseName: c.UseName,
|
||||
}
|
||||
return runtime.Log(c, options)
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ type LogOptions struct {
|
|||
Timestamps bool
|
||||
Multi bool
|
||||
WaitGroup *sync.WaitGroup
|
||||
UseNames bool
|
||||
UseName bool
|
||||
}
|
||||
|
||||
// LogLine describes the information for each line of a log
|
||||
|
@ -122,7 +122,7 @@ func getTailLog(path string, tail int) ([]*LogLine, error) {
|
|||
func (l *LogLine) String(options *LogOptions) string {
|
||||
var out string
|
||||
if options.Multi {
|
||||
if options.UseNames {
|
||||
if options.UseName {
|
||||
cname := l.CName
|
||||
out = fmt.Sprintf("%s ", cname)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue