Incorrect logging formatting #292

Closed
opened 2025-11-02 03:17:30 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @gabrieljackson on GitHub (Jan 27, 2017).

  • Gitea version (or commit ref): 25663b5816
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

I searched and didn't see this issue noted anywhere so I figured I would open a new one.

Currently, the logging code is often formatted to output something like "we ran into an error: %v", err, but is then passed to something like log.Fatal(). This leads to incorrect formatting when the log is written.

Example: https://github.com/go-gitea/gitea/blob/master/cmd/web_graceful.go#L36

2017/01/27 15:11:22 4Failed to load https cert file %s: %v0.0.0.0:3000open /data/key.pem: permission denied

I have started a local branch to convert many of the log calls from log.Fatal to log.Fatalf or similar and would be happy to open a PR for it.

Edit: fixed a bunch of typos in the original issue description.

Originally created by @gabrieljackson on GitHub (Jan 27, 2017). - Gitea version (or commit ref): 25663b58161c48bdc8e9cae900544378dede0d2b - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant ## Description I searched and didn't see this issue noted anywhere so I figured I would open a new one. Currently, the logging code is often formatted to output something like `"we ran into an error: %v", err`, but is then passed to something like `log.Fatal()`. This leads to incorrect formatting when the log is written. Example: https://github.com/go-gitea/gitea/blob/master/cmd/web_graceful.go#L36 ``` 2017/01/27 15:11:22 4Failed to load https cert file %s: %v0.0.0.0:3000open /data/key.pem: permission denied ``` I have started a local branch to convert many of the log calls from `log.Fatal` to `log.Fatalf` or similar and would be happy to open a PR for it. Edit: fixed a bunch of typos in the original issue description.
GiteaMirror added the type/enhancement label 2025-11-02 03:17:30 -06:00
Author
Owner

@bkcsoft commented on GitHub (Jan 28, 2017):

would be happy to open a PR for it.

Please do 🙂

@bkcsoft commented on GitHub (Jan 28, 2017): > would be happy to open a PR for it. Please do 🙂
Author
Owner

@tboerger commented on GitHub (Feb 10, 2017):

I would say it's done so far. If you think there are various other places that needs to be fixed feel free to reopen this issue.

@tboerger commented on GitHub (Feb 10, 2017): I would say it's done so far. If you think there are various other places that needs to be fixed feel free to reopen this issue.
Author
Owner

@lunny commented on GitHub (Feb 10, 2017):

lost

@lunny commented on GitHub (Feb 10, 2017): lost
Author
Owner

@tboerger commented on GitHub (Feb 10, 2017):

lost

What do you mean?

@tboerger commented on GitHub (Feb 10, 2017): > lost What do you mean?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#292