mirror of
https://github.com/Xevion/banner.git
synced 2025-12-06 21:14:26 -06:00
Switch all logging to logrus, lower session ID log level to debug
This commit is contained in:
5
api.go
5
api.go
@@ -4,10 +4,11 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -16,7 +17,7 @@ var (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
sessionID = RandomString(5) + Nonce()
|
sessionID = RandomString(5) + Nonce()
|
||||||
log.Printf("Session ID: %s", sessionID)
|
log.WithField("sessionId", sessionID).Debug("Session ID Generated")
|
||||||
}
|
}
|
||||||
|
|
||||||
type Term struct {
|
type Term struct {
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BuildRequestWithBody(method string, path string, params map[string]string, body io.Reader) *http.Request {
|
func BuildRequestWithBody(method string, path string, params map[string]string, body io.Reader) *http.Request {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
|
||||||
"net/http/cookiejar"
|
"net/http/cookiejar"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setup(cookies *cookiejar.Jar) {
|
func setup(cookies *cookiejar.Jar) {
|
||||||
|
|||||||
Reference in New Issue
Block a user