Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3751)

Issue 2525042: code review 2525042: log: roll back deprecation of old API to apply fix to l... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 6 months ago by r
Modified:
13 years, 6 months ago
Reviewers:
CC:
adg, golang-dev
Visibility:
Public.

Description

log: roll back deprecation of old API to apply fix to log.Output in public release.

Patch Set 1 #

Patch Set 2 : code review 2525042: log: roll back deprecation of old API to apply fix to l... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -1 line) Patch
M src/pkg/log/log.go View 2 chunks +40 lines, -1 line 0 comments Download

Messages

Total messages: 3
r
Hello adg (cc: golang-dev@googlegroups.com), I'd like you to review this change.
13 years, 6 months ago (2010-10-15 01:00:19 UTC) #1
r
*** Submitted as http://code.google.com/p/go/source/detail?r=ba1c74c43a11 *** log: roll back deprecation of old API to apply fix ...
13 years, 6 months ago (2010-10-15 01:02:16 UTC) #2
adg
13 years, 6 months ago (2010-10-15 01:07:17 UTC) #3
LGTM

On 15 October 2010 12:00,  <r@golang.org> wrote:
> Reviewers: adg,
>
> Message:
> Hello adg (cc: golang-dev@googlegroups.com),
>
> I'd like you to review this change.
>
>
> Description:
> log: roll back deprecation of old API to apply fix to log.Output in
> public release.
>
> Please review this at http://codereview.appspot.com/2525042/
>
> Affected files:
>  M src/pkg/log/log.go
>
>
> Index: src/pkg/log/log.go
> ===================================================================
> --- a/src/pkg/log/log.go
> +++ b/src/pkg/log/log.go
> @@ -49,7 +49,10 @@
>        return &Logger{out, prefix, flag}
>  }
>
> -var std = New(os.Stderr, "", Ldate|Ltime)
> +var (
> +       std    = New(os.Stderr, "", Ldate|Ltime)
> +       stdout = New(os.Stdout, "", Ldate|Ltime) // Deprecated.
> +)
>
>  // Cheap integer to fixed-width decimal ASCII.  Give a negative width to
> avoid zero-padding.
>  // Knows the buffer has capacity.
> @@ -221,3 +224,39 @@
>        std.Output(2, s)
>        panic(s)
>  }
> +
> +// Everything from here on is deprecated and will be removed after the next
> release.
> +
> +// Logf is analogous to Printf() for a Logger.
> +// Deprecated.
> +func (l *Logger) Logf(format string, v ...interface{}) {
> +       l.Output(2, fmt.Sprintf(format, v...))
> +}
> +
> +// Log is analogous to Print() for a Logger.
> +// Deprecated.
> +func (l *Logger) Log(v ...interface{}) { l.Output(2, fmt.Sprintln(v...)) }
> +
> +// Stdout is a helper function for easy logging to stdout. It is analogous
> to Print().
> +// Deprecated.
> +func Stdout(v ...interface{}) { stdout.Output(2, fmt.Sprint(v...)) }
> +
> +// Stderr is a helper function for easy logging to stderr. It is analogous
> to Fprint(os.Stderr).
> +// Deprecated.
> +func Stderr(v ...interface{}) { std.Output(2, fmt.Sprintln(v...)) }
> +
> +// Stdoutf is a helper functions for easy formatted logging to stdout. It
> is analogous to Printf().
> +// Deprecated.
> +func Stdoutf(format string, v ...interface{}) { stdout.Output(2,
> fmt.Sprintf(format, v...)) }
> +
> +// Stderrf is a helper function for easy formatted logging to stderr. It is
> analogous to Fprintf(os.Stderr).
> +// Deprecated.
> +func Stderrf(format string, v ...interface{}) { std.Output(2,
> fmt.Sprintf(format, v...)) }
> +
> +// Crash is equivalent to Stderr() followed by a call to panic().
> +// Deprecated.
> +func Crash(v ...interface{}) { Panicln(v...) }
> +
> +// Crashf is equivalent to Stderrf() followed by a call to panic().
> +// Deprecated.
> +func Crashf(format string, v ...interface{}) { Panicf(format, v...) }
>
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b