3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

improve logging

This commit is contained in:
Jeremy Latt 2014-03-05 23:07:55 -08:00
parent fa5b1e6cf7
commit 5c6f8ff92a
4 changed files with 7 additions and 7 deletions

View File

@ -18,7 +18,7 @@ func main() {
if *passwd != "" {
encoded, err := irc.GenerateEncodedPassword(*passwd)
if err != nil {
log.Fatal(err)
log.Fatal("encoding error: ", err)
}
fmt.Println(encoded)
return
@ -26,11 +26,11 @@ func main() {
config, err := irc.LoadConfig(*conf)
if err != nil {
log.Fatal(err)
log.Fatal("error loading config: ", err)
}
err = os.Chdir(filepath.Dir(*conf))
if err != nil {
log.Fatal(err)
log.Fatal("chdir error: ", err)
}
if *initdb {

View File

@ -13,7 +13,7 @@ type PassConfig struct {
func (conf *PassConfig) PasswordBytes() []byte {
bytes, err := DecodePassword(conf.Password)
if err != nil {
log.Fatal(err)
log.Fatal("decode password error: ", err)
}
return bytes
}

View File

@ -19,14 +19,14 @@ func InitDB(path string) {
topic TEXT NOT NULL,
user_limit INTEGER DEFAULT 0)`)
if err != nil {
log.Fatal(err)
log.Fatal("initdb error: ", err)
}
}
func OpenDB(path string) *sql.DB {
db, err := sql.Open("sqlite3", path)
if err != nil {
log.Fatal(err)
log.Fatal("open db error: ", err)
}
return db
}

View File

@ -66,7 +66,7 @@ func (server *Server) loadChannels() {
SELECT name, flags, key, topic, user_limit
FROM channel`)
if err != nil {
log.Fatal(err)
log.Fatal("error loading channels: ", err)
}
for rows.Next() {
var name, flags, key, topic string