func NewCustomizedLogger(level string, developerModeFlag bool) (*log.Logger, error) {
	logger := log.New()

	lv, err := log.ParseLevel(level)
	if err != nil {
		return nil, err
	}
	logger.Level = lv

	if developerModeFlag {
		customFormatter := new(log.TextFormatter)
		customFormatter.FullTimestamp = true
		customFormatter.TimestampFormat = "2006-01-02 15:04:05"
		log.SetFormatter(customFormatter)

		log.SetLevel(log.DebugLevel)
		logger.Level = lv
		logger.Formatter = customFormatter
	} else {
		customFormatter := new(log.JSONFormatter)
		customFormatter.TimestampFormat = "2006-01-02 15:04:05"

		log.SetFormatter(customFormatter)
		customFormatter.DisableTimestamp = false

		log.SetLevel(log.InfoLevel)
		logger.Level = lv
		logger.Formatter = customFormatter
	}

	logger.Out = os.Stdout

	return logger, nil
}
// NewCustomizedLogger creates a custom logger specifying the desired log level
// and the developer mode flag. Returns the logger object and the error.
NewCustomizedLogger creates a custom logger specifying the desired log level
and the developer mode flag. Returns the logger object and the error.
// NewCustomizedLogger creates a custom logger specifying the desired log level // and the developer mode flag . Returns the logger object and the error .
func NewCustomizedLogger(level string, developerModeFlag bool) (*log.Logger, error) {
	logger := log.New()
	lv, err := log.ParseLevel(level)
	if err != nil {
		return nil, err
	}
	logger.Level = lv
	if developerModeFlag {
		customFormatter := new(log.TextFormatter)
		customFormatter.FullTimestamp = true
		customFormatter.TimestampFormat = "2006-01-02 15:04:05"
		log.SetFormatter(customFormatter)
		log.SetLevel(log.DebugLevel)
		logger.Level = lv
		logger.Formatter = customFormatter
	} else {
		customFormatter := new(log.JSONFormatter)
		customFormatter.TimestampFormat = "2006-01-02 15:04:05"
		log.SetFormatter(customFormatter)
		customFormatter.DisableTimestamp = false
		log.SetLevel(log.InfoLevel)
		logger.Level = lv
		logger.Formatter = customFormatter
	}
	logger.Out = os.Stdout
	return logger, nil
}
func NewCustomizedLogger ( level string , developerModeFlag bool ) ( * log . Logger , error ) { logger := log . New ( ) lv , err := log . ParseLevel ( level ) if err != nil { return nil , err } logger . Level = lv if developerModeFlag { customFormatter := new ( log . TextFormatter ) customFormatter . FullTimestamp = true customFormatter . TimestampFormat = " " log . SetFormatter ( customFormatter ) log . SetLevel ( log . DebugLevel ) logger . Level = lv logger . Formatter = customFormatter } else { customFormatter := new ( log . JSONFormatter ) customFormatter . TimestampFormat = " " log . SetFormatter ( customFormatter ) customFormatter . DisableTimestamp = false log . SetLevel ( log . InfoLevel ) logger . Level = lv logger . Formatter = customFormatter } logger . Out = os . Stdout return logger , nil }
NewCustomizedLogger creates a custom logger specifying the desired log level
and the developer mode flag.
NewCustomizedLogger creates a custom logger specifying the desired log level and the developer mode flag .