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

Add support for log compression #3592

Merged
merged 2 commits into from
Jan 9, 2020
Merged

Add support for log compression #3592

merged 2 commits into from
Jan 9, 2020

Conversation

scrye
Copy link
Contributor

@scrye scrye commented Jan 8, 2020

Fixes #1924.


This change is Reviewable

@scrye scrye requested a review from karampok January 8, 2020 16:13
@scrye scrye self-assigned this Jan 8, 2020
Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on @karampok and @scrye)


go/lib/log/log.go, line 75 at r1 (raw file):

		MaxAge:     logAge,  // days
		MaxBackups: logBackups,
		Compress:   true,

That's prooobably not what you wanted to do :)

Copy link
Contributor Author

@scrye scrye left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on @karampok and @kormat)


go/lib/log/log.go, line 75 at r1 (raw file):

Previously, kormat (Stephen Shirley) wrote…

That's prooobably not what you wanted to do :)

The beauty of no acceptance tests for this 🎉. Fixed :)

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2.
Reviewable status: 1 of 6 files reviewed, all discussions resolved (waiting on @karampok)

Copy link
Contributor

@kormat kormat left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 5 of 6 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @karampok)

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


go/lib/log/flags.go, line 31 at r2 (raw file):

	logBackups  int
	logFlush    int
	logCompress bool

having inside log package a variable starting with logX seems redundant.
(log.logX)


go/lib/log/log.go, line 57 at r2 (raw file):

// logFlush = 0 logging output is unbuffered and Flush() is a no-op.
// Set compress to true to enable rotated file compression.
func SetupLogFile(name string, logDir string, logLevel string, logSize int, logAge int,

more than three arguments, should be a struct. But not important.
Another golang stylish comment
func SetupLogFile( name, dir, level string, size,age int)

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@scrye
Copy link
Contributor Author

scrye commented Jan 9, 2020


go/lib/log/log.go, line 57 at r2 (raw file):

Previously, karampok (Konstantinos) wrote…

more than three arguments, should be a struct. But not important.
Another golang stylish comment
func SetupLogFile( name, dir, level string, size,age int)

This is something I was also thinking about; the refactor was unnecessarily painful due to this not taking a struct.

Added to #3594.

@scrye
Copy link
Contributor Author

scrye commented Jan 9, 2020


go/lib/log/flags.go, line 31 at r2 (raw file):

Previously, karampok (Konstantinos) wrote…

having inside log package a variable starting with logX seems redundant.
(log.logX)

This is a good point, added to #3594.

@scrye scrye merged commit 1716c4f into scionproto:master Jan 9, 2020
@scrye scrye deleted the pubpr-fix-1924 branch January 9, 2020 13:00
karampok added a commit to karampok/scion that referenced this pull request Jan 29, 2020
According to the linter
```
func name will be used as log.LogPanicAndExit by other packages, and that stutters; consider calling this PanicAndExit

```

Contributes scionproto#3592
karampok added a commit to karampok/scion that referenced this pull request Jan 30, 2020
According to the linter
```
func name will be used as log.LogPanicAndExit by other packages, and that stutters; consider calling this PanicAndExit

```

Contributes scionproto#3592
karampok added a commit to karampok/scion that referenced this pull request Feb 17, 2020
According to the linter
```
func name will be used as log.LogPanicAndExit by other packages, and that stutters; consider calling this PanicAndExit

```

Contributes scionproto#3592
karampok added a commit to karampok/scion that referenced this pull request Feb 20, 2020
According to the linter
```
func name will be used as log.LogPanicAndExit by other packages, and that stutters; consider calling this PanicAndExit

```

Contributes scionproto#3592
karampok added a commit that referenced this pull request Feb 20, 2020
According to the linter

```
func name will be used as log.LogPanicAndExit by other packages, and that stutters; consider calling this PanicAndExit
```
The name HandlePanic was picked.

Contributes #3592
stygerma pushed a commit to stygerma/scion that referenced this pull request Mar 26, 2020
According to the linter

```
func name will be used as log.LogPanicAndExit by other packages, and that stutters; consider calling this PanicAndExit
```
The name HandlePanic was picked.

Contributes scionproto#3592
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.

Make rotated log compression an option for go/lib/log
3 participants