Permalink
Browse files

Properly markup bus stop so it can queried in the logs

  • Loading branch information...
kaihendry committed Jan 10, 2019
1 parent 9673670 commit 78e81c2eecac126cb04199ba96c7e975438e5b2f
Showing with 6 additions and 4 deletions.
  1. +2 −0 .upignore
  2. +1 −1 all.json
  3. +1 −1 allthebusstops.sh
  4. +2 −2 main.go
@@ -1 +1,3 @@
*.go
main
server
@@ -8045,7 +8045,7 @@
{
"BusStopCode": "30101",
"RoadName": "Brickland Rd",
"Description": "Before BLK 485B",
"Description": "BLK 485B",
"Latitude": 1.373713,
"Longitude": 103.738897
},
@@ -4,7 +4,7 @@ test -f .env && source .env

if ! test "$accountkey"
then
echo env AccountKey is unset
echo env \"accountkey\" is unset
exit
fi

@@ -125,7 +125,7 @@ func handleIndex(w http.ResponseWriter, r *http.Request) {
var arriving SGBusArrivals

if id != "" {
log.Infof("Looking up %q", id)
log.WithField("stop", id).Info("calling LTA API")
arriving, err = busArrivals(id)
if err != nil {
log.WithError(err).Error("failed to retrieve bus timings")
@@ -184,7 +184,7 @@ func addContextMiddleware(next http.Handler) http.Handler {
log.Fields{
"id": r.Header.Get("X-Request-Id"),
"country": r.Header.Get("Cloudfront-Viewer-Country"),
"UA": r.UserAgent(),
"ua": r.UserAgent(),
})
if cookie != nil {
cvisitor := context.WithValue(r.Context(), visitor, cookie.Value)

0 comments on commit 78e81c2

Please sign in to comment.