Bug 74322 - WebAudio: Use Logging instead of printf.
Summary: WebAudio: Use Logging instead of printf.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-12 12:59 PST by Jer Noble
Modified: 2012-01-12 14:12 PST (History)
3 users (show)

See Also:


Attachments
Patch (8.92 KB, patch)
2011-12-12 13:03 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (8.91 KB, patch)
2011-12-12 15:57 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (5.21 KB, patch)
2011-12-12 17:20 PST, Jer Noble
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2011-12-12 12:59:12 PST
WebAudio should use Logging instead of printf.
Comment 1 Jer Noble 2011-12-12 13:03:03 PST
Created attachment 118828 [details]
Patch
Comment 2 Jer Noble 2011-12-12 15:57:47 PST
Created attachment 118897 [details]
Patch

Rebased patch against ToT.
Comment 3 Sam Weinig 2011-12-12 16:45:56 PST
Comment on attachment 118897 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=118897&action=review

> Source/WebCore/webaudio/AudioContext.cpp:184
>  #if DEBUG_AUDIONODE_REFERENCES
> -    printf("%p: AudioContext::~AudioContext()\n", this);
> +    LOG(WebAudio, "%p: AudioContext::~AudioContext()\n", this);
>  #endif

If this is only for debugging, I don't think you should use printf.

> Source/WebCore/webaudio/AudioNode.cpp:314
>  void AudioNode::printNodeCounts()

Who calls this? If it is only for debugging (from a debugger) I think printf is probably more idiomatic.

> Source/WebCore/webaudio/DefaultAudioDestinationNode.cpp:54
>  #ifndef NDEBUG    
> -    fprintf(stderr, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
> +    LOG(WebAudio, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
>  #endif

This #ifndef is no longer needed.
Comment 4 Jer Noble 2011-12-12 17:01:00 PST
(In reply to comment #3)
> (From update of attachment 118897 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=118897&action=review
> 
> > Source/WebCore/webaudio/AudioContext.cpp:184
> >  #if DEBUG_AUDIONODE_REFERENCES
> > -    printf("%p: AudioContext::~AudioContext()\n", this);
> > +    LOG(WebAudio, "%p: AudioContext::~AudioContext()\n", this);
> >  #endif
> 
> If this is only for debugging, I don't think you should use printf.

Do you mean, "I don't think you should use LOG", or "I [do] think you should use printf"?

> > Source/WebCore/webaudio/AudioNode.cpp:314
> >  void AudioNode::printNodeCounts()
> 
> Who calls this? If it is only for debugging (from a debugger) I think printf is probably more idiomatic.

This is called by the AudioNode constructor, provided DEBUG_AUDIONODE_REFERENCES is enabled.

> > Source/WebCore/webaudio/DefaultAudioDestinationNode.cpp:54
> >  #ifndef NDEBUG    
> > -    fprintf(stderr, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
> > +    LOG(WebAudio, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
> >  #endif
> 
> This #ifndef is no longer needed.

I'll delete it.
Comment 5 Jer Noble 2011-12-12 17:20:12 PST
Created attachment 118918 [details]
Patch
Comment 6 Jer Noble 2012-01-12 14:12:06 PST
Committed r104857: <http://trac.webkit.org/changeset/104857>