Permalink
Browse files

Replace some usages of fmt for logging.

  • Loading branch information...
1 parent 974baf8 commit 6b1484d7629cafc16e0574afeb733d84275e52cf @iopred committed Mar 21, 2016
@@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"image/png"
+ "log"
"math"
"math/rand"
"strconv"
@@ -100,7 +101,7 @@ func (p *comicPlugin) makeComic(bot *bruxism.Bot, service bruxism.Service, messa
return
}
- fmt.Println(err)
+ log.Println("Error uploading comic: ", err)
service.SendMessage(message.Channel(), fmt.Sprintf("Sorry %s, there was a problem uploading the comic to imgur.", message.UserName()))
}
}()
@@ -2,6 +2,7 @@ package directmessageinviteplugin
import (
"fmt"
+ "log"
"strings"
"github.com/iopred/bruxism"
@@ -30,7 +31,7 @@ func directMessageInviteMessageFunc(bot *bruxism.Bot, service bruxism.Service, m
service.PrivateMessage(message.UserID(), "I have already joined that server.")
return
}
- fmt.Printf("Error joining %s %v", service.Name(), err)
+ log.Println("Error joining %s %v", service.Name(), err)
return
}
service.PrivateMessage(message.UserID(), "I have joined that server.")
@@ -2,6 +2,7 @@ package inviteplugin
import (
"fmt"
+ "log"
"strings"
"github.com/iopred/bruxism"
@@ -51,7 +52,7 @@ func InviteCommand(bot *bruxism.Bot, service bruxism.Service, message bruxism.Me
service.PrivateMessage(message.UserID(), "I have already joined that server.")
return
}
- fmt.Printf("Error joining %s %v", service.Name(), err)
+ log.Println("Error joining %s %v", service.Name(), err)
} else if service.Name() == bruxism.DiscordServiceName {
service.PrivateMessage(message.UserID(), "I have joined that server.")
}
@@ -4,6 +4,7 @@ import (
"bufio"
"encoding/json"
"fmt"
+ "log"
"os"
"sort"
"strings"
@@ -47,7 +48,7 @@ var MTGRestReplacer = strings.NewReplacer("*", "\\*")
func init() {
file, err := os.Open("mtg/AllSets-x.json")
if err != nil {
- fmt.Println(err)
+ log.Println(err)
return
}
defer file.Close()
@@ -57,7 +58,7 @@ func init() {
d := json.NewDecoder(bufio.NewReader(file))
err = d.Decode(&MTGSets)
if err != nil {
- fmt.Println(err)
+ log.Println(err)
return
}

0 comments on commit 6b1484d

Please sign in to comment.