summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-07-23 23:45:34 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-07-23 23:45:34 (GMT)
commit38cde493d2a9a1961e057fe0e175b437b3916148 (patch)
tree8c7451fb2a8466d0e25c95dd45f1a9dbf846b7dc /src
parentb29107e4dd06e176f88fdaa7f01bb6b1b34a8613 (diff)
refactored logging
Diffstat (limited to 'src')
-rw-r--r--src/rhimportd/ctrlTelnet.go2
-rw-r--r--src/rhimportd/ctrlWatchDir.go2
-rw-r--r--src/rhimportd/ctrlWebSimple.go2
-rw-r--r--src/rhimportd/ctrlWebSocket.go2
-rw-r--r--src/rhimportd/main.go7
5 files changed, 8 insertions, 7 deletions
diff --git a/src/rhimportd/ctrlTelnet.go b/src/rhimportd/ctrlTelnet.go
index 8ce4e83..c624654 100644
--- a/src/rhimportd/ctrlTelnet.go
+++ b/src/rhimportd/ctrlTelnet.go
@@ -182,7 +182,7 @@ func telnetSet(c *telgo.Client, args []string, conf *rhimport.Config, db *rddb.D
var ctx *rhimport.Context
if c.UserData == nil {
- c.UserData = rhimport.NewContext(conf, db)
+ c.UserData = rhimport.NewContext(conf, db, rhl, rhdl)
ctx = c.UserData.(*rhimport.Context)
ctx.Trusted = false
} else {
diff --git a/src/rhimportd/ctrlWatchDir.go b/src/rhimportd/ctrlWatchDir.go
index 2335c8f..0fd389d 100644
--- a/src/rhimportd/ctrlWatchDir.go
+++ b/src/rhimportd/ctrlWatchDir.go
@@ -110,7 +110,7 @@ func watchDirParseRequest(conf *rhimport.Config, db *rddb.DBChan, req *os.File)
return
}
- ctx = rhimport.NewContext(conf, db)
+ ctx = rhimport.NewContext(conf, db, rhl, rhdl)
ctx.UserName = reqdata.UserName
ctx.Trusted = true
ctx.ShowId = reqdata.ShowId
diff --git a/src/rhimportd/ctrlWebSimple.go b/src/rhimportd/ctrlWebSimple.go
index a44bc0f..f190f63 100644
--- a/src/rhimportd/ctrlWebSimple.go
+++ b/src/rhimportd/ctrlWebSimple.go
@@ -100,7 +100,7 @@ func webSimpleParseRequest(conf *rhimport.Config, db *rddb.DBChan, trusted bool,
return
}
- ctx = rhimport.NewContext(conf, db)
+ ctx = rhimport.NewContext(conf, db, rhl, rhdl)
if trusted {
ctx.UserName = r.Header.Get("X-Forwarded-User")
} else {
diff --git a/src/rhimportd/ctrlWebSocket.go b/src/rhimportd/ctrlWebSocket.go
index 1ce0f80..48c08fe 100644
--- a/src/rhimportd/ctrlWebSocket.go
+++ b/src/rhimportd/ctrlWebSocket.go
@@ -226,7 +226,7 @@ func webSocketDone(res rhimport.Result, userdata interface{}) bool {
}
func (self *webSocketSession) startNewSession(reqdata *webSocketRequestData, conf *rhimport.Config, sessions *rhimport.SessionStoreChan) (int, string) {
- ctx := rhimport.NewContext(conf, nil)
+ ctx := rhimport.NewContext(conf, nil, rhl, rhdl)
ctx.UserName = reqdata.UserName
ctx.Password = reqdata.Password
ctx.Trusted = false
diff --git a/src/rhimportd/main.go b/src/rhimportd/main.go
index 72785c0..4f12572 100644
--- a/src/rhimportd/main.go
+++ b/src/rhimportd/main.go
@@ -38,14 +38,15 @@ import (
)
var (
- rhl = log.New(os.Stderr, "[rhimportd]\t", log.LstdFlags)
- rhdl = log.New(ioutil.Discard, "[rhimportd-dbg]\t", log.LstdFlags)
+ rhl = log.New(os.Stderr, "[std] ", log.LstdFlags)
+ rhdl = log.New(ioutil.Discard, "[dbg] ", log.LstdFlags)
)
func init() {
if _, exists := os.LookupEnv("RHIMPORTD_DEBUG"); exists {
rhdl.SetOutput(os.Stderr)
}
+ rhimport.Init(rhl, rhdl)
}
type envStringValue string
@@ -128,7 +129,7 @@ func main() {
}
defer db.Cleanup()
- sessions, err := rhimport.NewSessionStore(conf, db.GetInterface())
+ sessions, err := rhimport.NewSessionStore(conf, db.GetInterface(), rhl, rhdl)
if err != nil {
rhl.Println("Error initializing Session Store:", err)
return