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

View File

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

View File

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

View File

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