Convert a bunch of wxLog* to the new logging method.

Originally committed to SVN as r4399.
This commit is contained in:
Amar Takhar 2010-06-01 08:21:30 +00:00
parent 798e18490d
commit d295ce7b0a
7 changed files with 27 additions and 11 deletions

View File

@ -49,6 +49,8 @@
#include <wx/tokenzr.h>
#endif
#include <libaegisub/log.h>
#include "ass_override.h"
#include "audio_box.h"
#include "audio_display.h"
@ -84,7 +86,7 @@ AudioKaraokeSyllable::AudioKaraokeSyllable(const AssKaraokeSyllable &base)
AudioKaraoke::AudioKaraoke(wxWindow *parent)
: wxWindow (parent,-1,wxDefaultPosition,wxSize(10,5),wxTAB_TRAVERSAL|wxBORDER_SUNKEN)
{
wxLogDebug(_T("AudioKaraoke constructor"));
LOG_D("karaoke") << "Constructor";
enabled = false;
splitting = false;
split_cursor_syl = -1;

View File

@ -49,6 +49,7 @@
#endif
#include <libaegisub/charset.h>
#include <libaegisub/log.h>
#include "charset_detect.h"
#include "text_file_reader.h"
@ -61,7 +62,7 @@
/// @return
///
wxString CharSetDetect::GetEncoding(wxString filename) {
wxLogDebug("Filename: %s", filename);
LOG_I("charset/file") << filename;
bool unknown = 0;
agi::charset::CharsetListDetected list;

View File

@ -75,6 +75,7 @@
#include <libaegisub/io.h>
#include <libaegisub/access.h>
#include <libaegisub/log.h>
///////////////////
// wxWidgets macro
@ -136,6 +137,9 @@ void SetThreadName(DWORD dwThreadID, LPCSTR szThreadName) {
/// @return
///
bool AegisubApp::OnInit() {
agi::log::EmitSTDOUT *emit_stdout = new agi::log::EmitSTDOUT();
emit_stdout->Enable();
#ifdef __VISUALC__
SetThreadName((DWORD) -1,"AegiMain");
#endif

View File

@ -50,6 +50,7 @@
#include <wx/wfstream.h>
#endif
#include <libaegisub/log.h>
#include <hunspell/hunspell.hxx>
#include "charset_conv.h"
@ -269,7 +270,7 @@ void HunspellSpellChecker::SetLanguage(wxString language) {
dicpath = wxString::Format("%s%s.dic", path, language);
usrdicpath = wxString::Format("%s%s.dic", userPath, language);
wxLogDebug("Using dictionary: %ls", dicpath);
LOG_I("dictionary/file") << dicpath;
// Check if language is available
if (!wxFileExists(affpath) || !wxFileExists(dicpath)) return;

View File

@ -52,6 +52,8 @@ extern "C" {
}
#endif
#include <libaegisub/log.h>
#include "ass_file.h"
#include "standard_paths.h"
#include "subtitles_provider_libass.h"
@ -63,10 +65,13 @@ extern "C" {
/// @brief Handle libass messages
///
static void msg_callback(int level, const char *fmt, va_list args, void *data) {
char buf[256];
snprintf(buf, sizeof(buf), fmt, args);
if (level < 2) // warning/error
wxVLogWarning(fmt, args);
LOG_I("subtitle/provider/libass") << buf;
else if (level < 7) // verbose
wxVLogDebug(fmt, args);
LOG_D("subtitle/provider/libass") << buf;
}

View File

@ -45,6 +45,8 @@
#include <string>
#endif
#include <libaegisub/log.h>
#include "charset_conv.h"
#ifdef WITH_UNIVCHARDET
#include "charset_detect.h"
@ -78,7 +80,7 @@ wxString TextFileReader::GetEncoding(wxString const& filename) {
// Use universalchardet library to detect charset
CharSetDetect det;
wxString str(det.GetEncoding(filename));
wxLogDebug("Encoding: %s", str);
LOG_I("file/reader/text/encoding") << str;
return str;
}

View File

@ -37,11 +37,12 @@
#include "config.h"
#ifndef AGI_PRE
#include <wx/log.h>
#include <algorithm>
#include <utility>
#endif
#include <libaegisub/log.h>
using std::min;
using std::max;
@ -85,7 +86,7 @@ static bool TestTexture(int width, int height, GLint format) {
glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format);
while (glGetError()) { } // Silently swallow all errors as we don't care why it failed if it did
wxLogDebug(L"VideoOutGL::TestTexture: %dx%d\n", width, height);
LOG_I("video/out/gl") << "VideoOutGL::TestTexture: " << width << "x" << height;
return format != 0;
}
@ -116,7 +117,7 @@ void VideoOutGL::DetectOpenGLCapabilities() {
// Test for the maximum supported texture size
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
while (maxTextureSize > 64 && !TestTexture(maxTextureSize, maxTextureSize, internalFormat)) maxTextureSize >>= 1;
wxLogDebug(L"VideoOutGL::DetectOpenGLCapabilities: Maximum texture size is %dx%d\n", maxTextureSize, maxTextureSize);
LOG_I("video/out/gl") << "Maximum texture size is " << maxTextureSize << "x" << maxTextureSize;
// Test for rectangular texture support
supportsRectangularTextures = TestTexture(maxTextureSize, maxTextureSize >> 1, internalFormat);
@ -136,7 +137,7 @@ void VideoOutGL::InitTextures(int width, int height, GLenum format, int bpp, boo
frameWidth = width;
frameHeight = height;
frameFormat = format;
wxLogDebug(L"VideoOutGL::InitTextures: Video size: %dx%d\n", width, height);
LOG_I("video/out/gl") << "Video size: " << width << "x" << height;
DetectOpenGLCapabilities();
@ -269,7 +270,7 @@ void VideoOutGL::InitTextures(int width, int height, GLenum format, int bpp, boo
for (int i = 0; i < textureCount; ++i) {
CHECK_ERROR(glBindTexture(GL_TEXTURE_2D, textureIdList[i]));
CHECK_INIT_ERROR(glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, textureSizes[i].first, textureSizes[i].second, 0, format, GL_UNSIGNED_BYTE, NULL));
wxLogDebug(L"VideoOutGL::InitTextures: Using texture size: %dx%d\n", textureSizes[i].first, textureSizes[i].second);
LOG_I("video/out/gl") << "Using texture size: " << textureSizes[i].first << "x" << textureSizes[i].second;
CHECK_INIT_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
CHECK_INIT_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
CHECK_INIT_ERROR(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP));