Browse Source

Add logging to bot

Toni Fadjukoff 6 years ago
parent
commit
1e28242bf0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      bot.go

+ 2 - 1
bot.go View File

331
 					if len(tracks) > 0 && (err != nil || !reflect.DeepEqual(currentTracks, tracks)) {
331
 					if len(tracks) > 0 && (err != nil || !reflect.DeepEqual(currentTracks, tracks)) {
332
 
332
 
333
 						if playlistID == "" {
333
 						if playlistID == "" {
334
-
334
+							log.Println("Creating new playlist")
335
 							info, err := app.spotify.client.CreatePlaylistForUser(app.credentials.SpotifyUser, title+" "+section.title, true)
335
 							info, err := app.spotify.client.CreatePlaylistForUser(app.credentials.SpotifyUser, title+" "+section.title, true)
336
 							if err != nil {
336
 							if err != nil {
337
 								log.Println("Error creating playlist to Spotify")
337
 								log.Println("Error creating playlist to Spotify")
341
 							changedWikiText = appendPlaylist(changedWikiText, info)
341
 							changedWikiText = appendPlaylist(changedWikiText, info)
342
 							message = message + fmt.Sprintf("Added link to Spotify playlist for week %d.", weekNumber)
342
 							message = message + fmt.Sprintf("Added link to Spotify playlist for week %d.", weekNumber)
343
 						}
343
 						}
344
+						log.Printf("Updating playlist %s for %s with tracks %s\n", playlistID, app.credentials.SpotifyUser, tracks)
344
 						err := app.spotify.client.ReplacePlaylistTracks(app.credentials.SpotifyUser, playlistID, tracks...)
345
 						err := app.spotify.client.ReplacePlaylistTracks(app.credentials.SpotifyUser, playlistID, tracks...)
345
 						if err != nil {
346
 						if err != nil {
346
 							log.Println("Error updating playlist to Spotify")
347
 							log.Println("Error updating playlist to Spotify")