Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getlantern/lantern#2232 Code review fixes #96

Merged
merged 5 commits into from
Feb 25, 2015
Merged

getlantern/lantern#2232 Code review fixes #96

merged 5 commits into from
Feb 25, 2015

Conversation

oxtoacart
Copy link
Contributor

@xiam Suggested updates for your logging implementation

@@ -8,7 +8,7 @@ VERSION="`git describe --abbrev=0 --tags --exact-match || git rev-parse --short
BUILD_DATE="`date -u +%Y%m%d%.%H%M%S`"
export VERSION_STRING="$VERSION ($BUILD_DATE)"
LOGGLY_TOKEN="469973d5-6eaf-445a-be71-cf27141316a1"
LDFLAGS="-w -X main.version $VERSION -X main.buildDate $BUILD_DATE -X main.logglyToken LOGGLY_TOKEN"
LDFLAGS="-w -X main.version $VERSION -X main.buildDate $BUILD_DATE -X github.com/getlantern/flashlight/logging.logglyToken $LOGGLY_TOKEN"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This never worked, so nothing ever actually got logged to Loggly. I fixed it to embed the token correctly and verified that we're getting data to Loggly now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ox! that's a testing-only token, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, that's the production token.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... that's a thing. Since that's the only thing one needs to post to loggly I was going to suggest we remove it from the public view and add it to too-many-secrets but then I realized it will be embedded into the binary anyway, so I guess we may as well leave it public for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, by definition it has to be public because our clients will use it to post.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 691776d on issue-2232-ox into * on issue-2232*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling c7c4934 on issue-2232-ox into * on issue-2232*.

@oxtoacart
Copy link
Contributor Author

@xiam How does it look?

@oxtoacart
Copy link
Contributor Author

@xiam I just thought of one more improvement. Will check in shortly.

@oxtoacart
Copy link
Contributor Author

@xiam Okay, change is made.

lang, _ := jibber_jabber.DetectLanguage()
logglyWriter := &logglyErrorWriter{
lang: lang,
tz: time.Now().Format("MST"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way we were getting the time zone before just printed "local". Now this prints a timezone string like "CST".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're forcing UTC in line 109:

+       return fmt.Fprintf(w, "%s - ", time.Now().In(time.UTC).Format(logTimestampFormat))

Should not this timezone match the actual date we're logging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question. We actually use the timezone to identify the user's location in case geolocation doesn't work, so we actually want the user's timezone, not the reported time.

When you look in Loggly, you can see that the timestamp is displayed with its timezone, so there should be little confusion.

I am going to rename timeZone to userTimeZone just to make it clearer.

screen shot 2015-02-25 at 11 11 12 am

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, our old logs already use the name "timeZone", so I'm going to leave it alone.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK! cool.

@xiam
Copy link
Contributor

xiam commented Feb 25, 2015

Thanks @oxtoacart, I'm into it.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 46e944d on issue-2232-ox into * on issue-2232*.

@@ -4,15 +4,17 @@ import (
"fmt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this systray_windows made it to here by accident, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup.

@xiam
Copy link
Contributor

xiam commented Feb 25, 2015

@oxtoacart Looks good to me and I've just checked that the systray_windows.go is the same one that is on the valencia branch (after the last merge), so it won't be a problem.

@xiam xiam merged commit ac1ccf3 into issue-2232 Feb 25, 2015
@xiam
Copy link
Contributor

xiam commented Feb 25, 2015

Merged, let me check my branch again. Thank you @oxtoacart!

@xiam xiam deleted the issue-2232-ox branch February 25, 2015 17:50
@oxtoacart
Copy link
Contributor Author

@xiam Thanks!

@getlantern getlantern deleted a comment from fffw Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants