diff options
| author | Aleksey Kosov <rusyak777@list.ru> | 2025-06-24 18:44:06 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-24 08:44:06 -0700 |
| commit | 4511c2cc1f0aef4f0df8712f17dc62606a9949e0 (patch) | |
| tree | 0b82709d104ae8882acd14f5047d020df9375524 /weed/filer/abstract_sql | |
| parent | 2cdd8092cc57cb828e92588d5f09f594bcc82f26 (diff) | |
| download | seaweedfs-4511c2cc1f0aef4f0df8712f17dc62606a9949e0.tar.xz seaweedfs-4511c2cc1f0aef4f0df8712f17dc62606a9949e0.zip | |
Changes logging function (#6919)
* updated logging methods for stores
* updated logging methods for stores
* updated logging methods for filer
* updated logging methods for uploader and http_util
* updated logging methods for weed server
---------
Co-authored-by: akosov <a.kosov@kryptonite.ru>
Diffstat (limited to 'weed/filer/abstract_sql')
| -rw-r--r-- | weed/filer/abstract_sql/abstract_sql_store.go | 8 | ||||
| -rw-r--r-- | weed/filer/abstract_sql/abstract_sql_store_kv.go | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/weed/filer/abstract_sql/abstract_sql_store.go b/weed/filer/abstract_sql/abstract_sql_store.go index 1d175651d..23fbbd546 100644 --- a/weed/filer/abstract_sql/abstract_sql_store.go +++ b/weed/filer/abstract_sql/abstract_sql_store.go @@ -169,7 +169,7 @@ func (store *AbstractSqlStore) InsertEntry(ctx context.Context, entry *filer.Ent if err != nil && strings.Contains(strings.ToLower(err.Error()), "duplicate entry") { // now the insert failed possibly due to duplication constraints sqlInsert = "falls back to update" - glog.V(1).Infof("insert %s %s: %v", entry.FullPath, sqlInsert, err) + glog.V(1).InfofCtx(ctx, "insert %s %s: %v", entry.FullPath, sqlInsert, err) res, err = db.ExecContext(ctx, store.GetSqlUpdate(bucket), meta, util.HashStringToLong(dir), name, dir) } if err != nil { @@ -277,7 +277,7 @@ func (store *AbstractSqlStore) DeleteFolderChildren(ctx context.Context, fullpat } } - glog.V(4).Infof("delete %s SQL %s %d", string(shortPath), store.GetSqlDeleteFolderChildren(bucket), util.HashStringToLong(string(shortPath))) + glog.V(4).InfofCtx(ctx, "delete %s SQL %s %d", string(shortPath), store.GetSqlDeleteFolderChildren(bucket), util.HashStringToLong(string(shortPath))) res, err := db.ExecContext(ctx, store.GetSqlDeleteFolderChildren(bucket), util.HashStringToLong(string(shortPath)), string(shortPath)) if err != nil { return fmt.Errorf("deleteFolderChildren %s: %s", fullpath, err) @@ -312,7 +312,7 @@ func (store *AbstractSqlStore) ListDirectoryPrefixedEntries(ctx context.Context, var name string var data []byte if err = rows.Scan(&name, &data); err != nil { - glog.V(0).Infof("scan %s : %v", dirPath, err) + glog.V(0).InfofCtx(ctx, "scan %s : %v", dirPath, err) return lastFileName, fmt.Errorf("scan %s: %v", dirPath, err) } lastFileName = name @@ -321,7 +321,7 @@ func (store *AbstractSqlStore) ListDirectoryPrefixedEntries(ctx context.Context, FullPath: util.NewFullPath(string(dirPath), name), } if err = entry.DecodeAttributesAndChunks(util.MaybeDecompressData(data)); err != nil { - glog.V(0).Infof("scan decode %s : %v", entry.FullPath, err) + glog.V(0).InfofCtx(ctx, "scan decode %s : %v", entry.FullPath, err) return lastFileName, fmt.Errorf("scan decode %s : %v", entry.FullPath, err) } diff --git a/weed/filer/abstract_sql/abstract_sql_store_kv.go b/weed/filer/abstract_sql/abstract_sql_store_kv.go index 221902aaa..afc8474b7 100644 --- a/weed/filer/abstract_sql/abstract_sql_store_kv.go +++ b/weed/filer/abstract_sql/abstract_sql_store_kv.go @@ -31,7 +31,7 @@ func (store *AbstractSqlStore) KvPut(ctx context.Context, key []byte, value []by } // now the insert failed possibly due to duplication constraints - glog.V(1).Infof("kv insert falls back to update: %s", err) + glog.V(1).InfofCtx(ctx, "kv insert falls back to update: %s", err) res, err = db.ExecContext(ctx, store.GetSqlUpdate(DEFAULT_TABLE), value, dirHash, name, dirStr) if err != nil { |
