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

Accounting support #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

MirageTurtle
Copy link

@MirageTurtle MirageTurtle commented Jul 28, 2024

Add basic logging and accounting support via hourly parsing logs.

Just support access log for accounting.
@MirageTurtle MirageTurtle requested review from iBug and taoky July 28, 2024 08:51
src/main.go Outdated Show resolved Hide resolved
src/main.go Outdated Show resolved Hide resolved
src/main.go Outdated Show resolved Hide resolved
src/main.go Outdated Show resolved Hide resolved
src/main.go Outdated Show resolved Hide resolved
@MirageTurtle MirageTurtle requested a review from iBug July 28, 2024 12:46
src/go.sum Outdated Show resolved Hide resolved
src/ganted2radius.go Outdated Show resolved Hide resolved
@MirageTurtle MirageTurtle requested review from taoky and iBug July 31, 2024 10:22
src/ganted2radius.go Outdated Show resolved Hide resolved
src/ganted2radius.go Outdated Show resolved Hide resolved
src/ganted2radius.go Outdated Show resolved Hide resolved
Copy link
Member

@iBug iBug left a comment

Choose a reason for hiding this comment

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

There are many occurrences of fmt.Printf and fmt.Fprintf(os.Stderr, they're better replaced by log.Printf instead.

src/ganted2radius.go Show resolved Hide resolved
src/ganted2radius.go Show resolved Hide resolved
src/main.go Outdated Show resolved Hide resolved
src/main.go Show resolved Hide resolved
1. defer the close of `archiveFile` and `src`
2. use `log.Printf` to replace `fmt.Printf` and `fmt.Fprintf`
3. `panic()` if the log directory does not exist and can not be
created either
4. fetching the previous writer and close it if valid
src/main.go Outdated Show resolved Hide resolved
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.

3 participants