api.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2015 Google Inc. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package log
  5. // This file implements the logging API.
  6. import (
  7. "golang.org/x/net/context"
  8. "google.golang.org/appengine/internal"
  9. )
  10. // Debugf formats its arguments according to the format, analogous to fmt.Printf,
  11. // and records the text as a log message at Debug level. The message will be associated
  12. // with the request linked with the provided context.
  13. func Debugf(ctx context.Context, format string, args ...interface{}) {
  14. internal.Logf(ctx, 0, format, args...)
  15. }
  16. // Infof is like Debugf, but at Info level.
  17. func Infof(ctx context.Context, format string, args ...interface{}) {
  18. internal.Logf(ctx, 1, format, args...)
  19. }
  20. // Warningf is like Debugf, but at Warning level.
  21. func Warningf(ctx context.Context, format string, args ...interface{}) {
  22. internal.Logf(ctx, 2, format, args...)
  23. }
  24. // Errorf is like Debugf, but at Error level.
  25. func Errorf(ctx context.Context, format string, args ...interface{}) {
  26. internal.Logf(ctx, 3, format, args...)
  27. }
  28. // Criticalf is like Debugf, but at Critical level.
  29. func Criticalf(ctx context.Context, format string, args ...interface{}) {
  30. internal.Logf(ctx, 4, format, args...)
  31. }