mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Improve boot logging for database
This commit is contained in:
parent
2d8152381c
commit
c925f06326
4 changed files with 20 additions and 7 deletions
|
|
@ -32,6 +32,7 @@ import (
|
|||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/88250/go-humanize"
|
||||
"github.com/88250/gulu"
|
||||
figure "github.com/common-nighthawk/go-figure"
|
||||
"github.com/gofrs/flock"
|
||||
|
|
@ -500,3 +501,13 @@ func UnlockWorkspace() {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
func LogDatabaseSize(dbPath string) {
|
||||
dbFile, err := os.Stat(dbPath)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
dbSize := humanize.BytesCustomCeil(uint64(dbFile.Size()), 2)
|
||||
logging.LogInfof("database [%s] size [%s]", dbPath, dbSize)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue