diff options
author | zeripath <art27@cantab.net> | 2022-03-10 10:09:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 10:09:48 +0000 |
commit | 75eb6cc9c1efde75d2b34d85d4a3e4f8484e6ab4 (patch) | |
tree | 4bb86ebef192609633a89cc9f05bdfc9ad85e77a /modules/lfs | |
parent | 1314f38b59748397b3429fb9bc9f9d6bac85d2f2 (diff) | |
download | gitea-75eb6cc9c1efde75d2b34d85d4a3e4f8484e6ab4.tar.gz gitea-75eb6cc9c1efde75d2b34d85d4a3e4f8484e6ab4.zip |
Improve SyncMirrors logging (#19045)
Yet another issue has come up where the logging from SyncMirrors does not provide
enough context. This PR adds more context to these logging events.
Related #19038
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/lfs')
-rw-r--r-- | modules/lfs/pointer.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/lfs/pointer.go b/modules/lfs/pointer.go index 975b5e7dc6..2a3a2116b4 100644 --- a/modules/lfs/pointer.go +++ b/modules/lfs/pointer.go @@ -14,6 +14,8 @@ import ( "regexp" "strconv" "strings" + + "code.gitea.io/gitea/modules/log" ) const ( @@ -111,6 +113,17 @@ func (p Pointer) RelativePath() string { return path.Join(p.Oid[0:2], p.Oid[2:4], p.Oid[4:]) } +// ColorFormat provides a basic color format for a Team +func (p Pointer) ColorFormat(s fmt.State) { + if p.Oid == "" && p.Size == 0 { + log.ColorFprintf(s, "<empty>") + return + } + log.ColorFprintf(s, "%s:%d", + log.NewColoredIDValue(p.Oid), + p.Size) +} + // GeneratePointer generates a pointer for arbitrary content func GeneratePointer(content io.Reader) (Pointer, error) { h := sha256.New() |