mirror of
https://github.com/Xevion/banner.git
synced 2025-12-08 12:06:28 -06:00
Switch from logrus to zerolog, move types into types.go
This commit is contained in:
10
session.go
10
session.go
@@ -4,12 +4,12 @@ import (
|
||||
"net/http/cookiejar"
|
||||
"net/url"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
log "github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
func setup(cookies *cookiejar.Jar) {
|
||||
// Makes the initial requests that sets up the session cookies for the rest of the application
|
||||
log.Println("Setting up session...")
|
||||
log.Info().Msg("Setting up session...")
|
||||
|
||||
request_queue := []string{
|
||||
"/registration/registration",
|
||||
@@ -26,7 +26,7 @@ func setup(cookies *cookiejar.Jar) {
|
||||
// Validate that cookies were set
|
||||
baseURL_parsed, err := url.Parse(baseURL)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to parse baseURL: %s", baseURL)
|
||||
log.Fatal().Msgf("Failed to parse baseURL: %s", baseURL)
|
||||
}
|
||||
|
||||
current_cookies := cookies.Cookies(baseURL_parsed)
|
||||
@@ -46,10 +46,10 @@ func setup(cookies *cookiejar.Jar) {
|
||||
// Check if all required cookies were set
|
||||
for cookie_name, cookie_set := range required_cookies {
|
||||
if !cookie_set {
|
||||
log.Fatalf("Required cookie %s was not set", cookie_name)
|
||||
log.Error().Msgf("Required cookie %s was not set", cookie_name)
|
||||
}
|
||||
}
|
||||
log.Println("All cookies acquired. Session setup complete.")
|
||||
log.Info().Msg("All cookies acquired. Session setup complete.")
|
||||
|
||||
// TODO: Validate that the session allows access to termSelection
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user