mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 05:35:49 +02:00
Add timestamp to logs
This commit is contained in:
@@ -39,15 +39,17 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
opts = &config.KanikoOptions{}
|
||||
force bool
|
||||
logLevel string
|
||||
logFormat string
|
||||
opts = &config.KanikoOptions{}
|
||||
force bool
|
||||
logLevel string
|
||||
logFormat string
|
||||
logTimestamp bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
RootCmd.PersistentFlags().StringVarP(&logLevel, "verbosity", "v", logging.DefaultLevel, "Log level (debug, info, warn, error, fatal, panic")
|
||||
RootCmd.PersistentFlags().StringVar(&logFormat, "log-format", logging.FormatColor, "Log format (text, color, json)")
|
||||
RootCmd.PersistentFlags().BoolVar(&logTimestamp, "log-timestamp", logging.DefaultLogTimestamp, "Timestamp in log output")
|
||||
|
||||
RootCmd.PersistentFlags().BoolVarP(&force, "force", "", false, "Force building outside of a container")
|
||||
|
||||
@@ -62,7 +64,7 @@ var RootCmd = &cobra.Command{
|
||||
if cmd.Use == "executor" {
|
||||
resolveEnvironmentBuildArgs(opts.BuildArgs, os.Getenv)
|
||||
|
||||
if err := logging.Configure(logLevel, logFormat); err != nil {
|
||||
if err := logging.Configure(logLevel, logFormat, logTimestamp); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user