Replaced panic(fmt.Sprintf()) with log.Panicf