Include driver name in trace messsages
Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
b645555422
commit
81c465cef0
1 changed files with 9 additions and 9 deletions
|
@ -53,7 +53,7 @@ type Base struct {
|
||||||
// GetContent wraps GetContent of underlying storage driver.
|
// GetContent wraps GetContent of underlying storage driver.
|
||||||
func (base *Base) GetContent(path string) ([]byte, error) {
|
func (base *Base) GetContent(path string) ([]byte, error) {
|
||||||
_, done := context.WithTrace(context.Background())
|
_, done := context.WithTrace(context.Background())
|
||||||
defer done("Base.GetContent(\"%s\")", path)
|
defer done("%s.GetContent(%q)", base.Name(), path)
|
||||||
|
|
||||||
if !storagedriver.PathRegexp.MatchString(path) {
|
if !storagedriver.PathRegexp.MatchString(path) {
|
||||||
return nil, storagedriver.InvalidPathError{Path: path}
|
return nil, storagedriver.InvalidPathError{Path: path}
|
||||||
|
@ -65,7 +65,7 @@ func (base *Base) GetContent(path string) ([]byte, error) {
|
||||||
// PutContent wraps PutContent of underlying storage driver.
|
// PutContent wraps PutContent of underlying storage driver.
|
||||||
func (base *Base) PutContent(path string, content []byte) error {
|
func (base *Base) PutContent(path string, content []byte) error {
|
||||||
_, done := context.WithTrace(context.Background())
|
_, done := context.WithTrace(context.Background())
|
||||||
defer done("Base.PutContent(\"%s\")", path)
|
defer done("%s.PutContent(%q)", base.Name(), path)
|
||||||
|
|
||||||
if !storagedriver.PathRegexp.MatchString(path) {
|
if !storagedriver.PathRegexp.MatchString(path) {
|
||||||
return storagedriver.InvalidPathError{Path: path}
|
return storagedriver.InvalidPathError{Path: path}
|
||||||
|
@ -77,7 +77,7 @@ func (base *Base) PutContent(path string, content []byte) error {
|
||||||
// ReadStream wraps ReadStream of underlying storage driver.
|
// ReadStream wraps ReadStream of underlying storage driver.
|
||||||
func (base *Base) ReadStream(path string, offset int64) (io.ReadCloser, error) {
|
func (base *Base) ReadStream(path string, offset int64) (io.ReadCloser, error) {
|
||||||
_, done := context.WithTrace(context.Background())
|
_, done := context.WithTrace(context.Background())
|
||||||
defer done("Base.ReadStream(\"%s\", %d)", path, offset)
|
defer done("%s.ReadStream(%q, %d)", base.Name(), path, offset)
|
||||||
|
|
||||||
if offset < 0 {
|
if offset < 0 {
|
||||||
return nil, storagedriver.InvalidOffsetError{Path: path, Offset: offset}
|
return nil, storagedriver.InvalidOffsetError{Path: path, Offset: offset}
|
||||||
|
@ -93,7 +93,7 @@ func (base *Base) ReadStream(path string, offset int64) (io.ReadCloser, error) {
|
||||||
// WriteStream wraps WriteStream of underlying storage driver.
|
// WriteStream wraps WriteStream of underlying storage driver.
|
||||||
func (base *Base) WriteStream(path string, offset int64, reader io.Reader) (nn int64, err error) {
|
func (base *Base) WriteStream(path string, offset int64, reader io.Reader) (nn int64, err error) {
|
||||||
_, done := context.WithTrace(context.Background())
|
_, done := context.WithTrace(context.Background())
|
||||||
defer done("Base.WriteStream(\"%s\", %d)", path, offset)
|
defer done("%s.WriteStream(%q, %d)", base.Name(), path, offset)
|
||||||
|
|
||||||
if offset < 0 {
|
if offset < 0 {
|
||||||
return 0, storagedriver.InvalidOffsetError{Path: path, Offset: offset}
|
return 0, storagedriver.InvalidOffsetError{Path: path, Offset: offset}
|
||||||
|
@ -109,7 +109,7 @@ func (base *Base) WriteStream(path string, offset int64, reader io.Reader) (nn i
|
||||||
// Stat wraps Stat of underlying storage driver.
|
// Stat wraps Stat of underlying storage driver.
|
||||||
func (base *Base) Stat(path string) (storagedriver.FileInfo, error) {
|
func (base *Base) Stat(path string) (storagedriver.FileInfo, error) {
|
||||||
_, done := context.WithTrace(context.Background())
|
_, done := context.WithTrace(context.Background())
|
||||||
defer done("Base.Stat(\"%s\")", path)
|
defer done("%s.Stat(%q)", base.Name(), path)
|
||||||
|
|
||||||
if !storagedriver.PathRegexp.MatchString(path) {
|
if !storagedriver.PathRegexp.MatchString(path) {
|
||||||
return nil, storagedriver.InvalidPathError{Path: path}
|
return nil, storagedriver.InvalidPathError{Path: path}
|
||||||
|
@ -121,7 +121,7 @@ func (base *Base) Stat(path string) (storagedriver.FileInfo, error) {
|
||||||
// List wraps List of underlying storage driver.
|
// List wraps List of underlying storage driver.
|
||||||
func (base *Base) List(path string) ([]string, error) {
|
func (base *Base) List(path string) ([]string, error) {
|
||||||
_, done := context.WithTrace(context.Background())
|
_, done := context.WithTrace(context.Background())
|
||||||
defer done("Base.List(\"%s\")", path)
|
defer done("%s.List(%q)", base.Name(), path)
|
||||||
|
|
||||||
if !storagedriver.PathRegexp.MatchString(path) && path != "/" {
|
if !storagedriver.PathRegexp.MatchString(path) && path != "/" {
|
||||||
return nil, storagedriver.InvalidPathError{Path: path}
|
return nil, storagedriver.InvalidPathError{Path: path}
|
||||||
|
@ -133,7 +133,7 @@ func (base *Base) List(path string) ([]string, error) {
|
||||||
// Move wraps Move of underlying storage driver.
|
// Move wraps Move of underlying storage driver.
|
||||||
func (base *Base) Move(sourcePath string, destPath string) error {
|
func (base *Base) Move(sourcePath string, destPath string) error {
|
||||||
_, done := context.WithTrace(context.Background())
|
_, done := context.WithTrace(context.Background())
|
||||||
defer done("Base.Move(\"%s\", \"%s\"", sourcePath, destPath)
|
defer done("%s.Move(%q, %q", base.Name(), sourcePath, destPath)
|
||||||
|
|
||||||
if !storagedriver.PathRegexp.MatchString(sourcePath) {
|
if !storagedriver.PathRegexp.MatchString(sourcePath) {
|
||||||
return storagedriver.InvalidPathError{Path: sourcePath}
|
return storagedriver.InvalidPathError{Path: sourcePath}
|
||||||
|
@ -147,7 +147,7 @@ func (base *Base) Move(sourcePath string, destPath string) error {
|
||||||
// Delete wraps Delete of underlying storage driver.
|
// Delete wraps Delete of underlying storage driver.
|
||||||
func (base *Base) Delete(path string) error {
|
func (base *Base) Delete(path string) error {
|
||||||
_, done := context.WithTrace(context.Background())
|
_, done := context.WithTrace(context.Background())
|
||||||
defer done("Base.Delete(\"%s\")", path)
|
defer done("%s.Delete(%q)", base.Name(), path)
|
||||||
|
|
||||||
if !storagedriver.PathRegexp.MatchString(path) {
|
if !storagedriver.PathRegexp.MatchString(path) {
|
||||||
return storagedriver.InvalidPathError{Path: path}
|
return storagedriver.InvalidPathError{Path: path}
|
||||||
|
@ -159,7 +159,7 @@ func (base *Base) Delete(path string) error {
|
||||||
// URLFor wraps URLFor of underlying storage driver.
|
// URLFor wraps URLFor of underlying storage driver.
|
||||||
func (base *Base) URLFor(path string, options map[string]interface{}) (string, error) {
|
func (base *Base) URLFor(path string, options map[string]interface{}) (string, error) {
|
||||||
_, done := context.WithTrace(context.Background())
|
_, done := context.WithTrace(context.Background())
|
||||||
defer done("Base.URLFor(\"%s\")", path)
|
defer done("%s.URLFor(%q)", base.Name(), path)
|
||||||
|
|
||||||
if !storagedriver.PathRegexp.MatchString(path) {
|
if !storagedriver.PathRegexp.MatchString(path) {
|
||||||
return "", storagedriver.InvalidPathError{Path: path}
|
return "", storagedriver.InvalidPathError{Path: path}
|
||||||
|
|
Loading…
Reference in a new issue