Switch from logrus to zerolog, move types into types.go

This commit is contained in:
2023-12-24 15:47:11 -06:00
parent 40330c37ce
commit 4dce1de842
7 changed files with 95 additions and 96 deletions

6
api.go
View File

@@ -8,7 +8,7 @@ import (
"strings"
"time"
log "github.com/sirupsen/logrus"
log "github.com/rs/zerolog/log"
)
var (
@@ -17,7 +17,7 @@ var (
func init() {
sessionID = RandomString(5) + Nonce()
log.WithField("sessionId", sessionID).Debug("Session ID Generated")
log.Debug().Str("sessionId", sessionID).Msg("Session ID Generated")
}
type Term struct {
@@ -262,7 +262,7 @@ func GetCourseMeetingTime(term int, crn int) (*MeetingTimeResponse, error) {
// Assert that the response is JSON
if !ContainsContentType(res.Header.Get("Content-Type"), "application/json") {
log.Fatalf("Response was not JSON: %s", res.Header.Get("Content-Type"))
log.Fatal().Msgf("Response was not JSON: %s", res.Header.Get("Content-Type"))
}
// Read the response body into JSON