Changeset 104857 in webkit


Ignore:
Timestamp:
Jan 12, 2012 2:11:52 PM (12 years ago)
Author:
jer.noble@apple.com
Message:

WebAudio: Use Logging instead of printf.
https://bugs.webkit.org/show_bug.cgi?id=74322

Reviewed by Darin Adler.

No new tests; no net change in functionality.

Add a new WebCoreLogLevel for WebAudio, and use this new log level instead of
printf statements in webaudio classes.

  • platform/Logging.cpp:

(WebCore::getChannelFromName):

  • platform/Logging.h:
  • platform/mac/LoggingMac.mm:

(WebCore::InitializeLoggingChannelsIfNecessary):

  • platform/audio/FFTFrame.cpp:

(WebCore::FFTFrame::print):

  • webaudio/DefaultAudioDestinationNode.cpp:

(WebCore::DefaultAudioDestinationNode::initialize):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r104855 r104857  
     12011-12-12  Jer Noble  <jer.noble@apple.com>
     2
     3        WebAudio: Use Logging instead of printf.
     4        https://bugs.webkit.org/show_bug.cgi?id=74322
     5
     6        Reviewed by Darin Adler.
     7
     8        No new tests; no net change in functionality.
     9
     10        Add a new WebCoreLogLevel for WebAudio, and use this new log level instead of
     11        printf statements in webaudio classes.
     12
     13        * platform/Logging.cpp:
     14        (WebCore::getChannelFromName):
     15        * platform/Logging.h:
     16        * platform/mac/LoggingMac.mm:
     17        (WebCore::InitializeLoggingChannelsIfNecessary):
     18        * platform/audio/FFTFrame.cpp:
     19        (WebCore::FFTFrame::print):
     20        * webaudio/DefaultAudioDestinationNode.cpp:
     21        (WebCore::DefaultAudioDestinationNode::initialize):
     22
    1232012-01-12  Anders Carlsson  <andersca@apple.com>
    224
  • trunk/Source/WebCore/platform/Logging.cpp

    r69898 r104857  
    6161
    6262WTFLogChannel LogFileAPI =           { 0x10000000, "WebCoreLogLevel", WTFLogChannelOff };
     63
     64WTFLogChannel LogWebAudio =          { 0x20000000, "WebCoreLogLevel", WTFLogChannelOff };
    6365
    6466WTFLogChannel* getChannelFromName(const String& channelName)
     
    136138        return &LogFileAPI;
    137139
     140    if (equalIgnoringCase(channelName, String("WebAudio")))
     141        return &LogWebAudio;
     142
    138143    return 0;
    139144}
  • trunk/Source/WebCore/platform/Logging.h

    r102235 r104857  
    6060    extern WTFLogChannel LogProgress;
    6161    extern WTFLogChannel LogFileAPI;
     62    extern WTFLogChannel LogWebAudio;
    6263
    6364    void initializeLoggingChannelsIfNecessary();
  • trunk/Source/WebCore/platform/audio/FFTFrame.cpp

    r95901 r104857  
    3737#endif
    3838
     39#include "Logging.h"
    3940#include <wtf/Complex.h>
    4041#include <wtf/MathExtras.h>
     
    254255    float* realP = frame.realData();
    255256    float* imagP = frame.imagData();
    256     printf("**** \n");
    257     printf("DC = %f : nyquist = %f\n", realP[0], imagP[0]);
     257    LOG(WebAudio, "**** \n");
     258    LOG(WebAudio, "DC = %f : nyquist = %f\n", realP[0], imagP[0]);
    258259
    259260    int n = m_FFTSize / 2;
     
    263264        double phase = atan2(realP[i], imagP[i]);
    264265
    265         printf("[%d] (%f %f)\n", i, mag, phase);
    266     }
    267     printf("****\n");
     266        LOG(WebAudio, "[%d] (%f %f)\n", i, mag, phase);
     267    }
     268    LOG(WebAudio, "****\n");
    268269}
    269270#endif // NDEBUG
  • trunk/Source/WebCore/platform/mac/LoggingMac.mm

    r102235 r104857  
    7373    initializeWithUserDefault(LogPlugins);
    7474    initializeWithUserDefault(LogArchives);
     75    initializeWithUserDefault(LogWebAudio);
    7576}
    7677
  • trunk/Source/WebCore/webaudio/DefaultAudioDestinationNode.cpp

    r96745 r104857  
    2929#include "DefaultAudioDestinationNode.h"
    3030
    31 #ifndef NDEBUG
    32 #include <stdio.h>
    33 #endif
     31#include "Logging.h"
    3432
    3533namespace WebCore {
     
    5250
    5351    float hardwareSampleRate = AudioDestination::hardwareSampleRate();
    54 #ifndef NDEBUG   
    55     fprintf(stderr, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
    56 #endif
     52    LOG(WebAudio, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
    5753   
    5854    m_destination = AudioDestination::create(*this, hardwareSampleRate);
Note: See TracChangeset for help on using the changeset viewer.