Merge pull request #692 from birarda/master

Cleaner buffer flush for QDebug message handler
This commit is contained in:
ZappoMan 2013-07-16 16:09:52 -07:00
commit f6619c6d05
5 changed files with 14 additions and 6 deletions

View file

@ -165,9 +165,7 @@ void GLCanvas::wheelEvent(QWheelEvent* event) {
}
void messageHandler(QtMsgType type, const char* message) {
printf("%s", message);
fflush(stdout);
fprintf(stdout, "%s", message);
LogDisplay::instance.addMessage(message);
}

View file

@ -188,6 +188,10 @@ bool cmdOptionExists(int argc, const char * argv[],const char* option) {
return false;
}
void sharedMessageHandler(QtMsgType type, const char* message) {
fprintf(stdout, "%s", message);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Function: createVoxelEditMessage()
// Description: creates an "insert" or "remove" voxel message for a voxel code

View file

@ -9,9 +9,11 @@
#ifndef __hifi__SharedUtil__
#define __hifi__SharedUtil__
#include <math.h>
#include <stdint.h>
#include <unistd.h>
#include <math.h>
#include <QDebug>
#ifdef _WIN32
#include "Systime.h"
@ -66,6 +68,8 @@ void loadRandomIdentifier(unsigned char* identifierBuffer, int numBytes);
const char* getCmdOption(int argc, const char * argv[],const char* option);
bool cmdOptionExists(int argc, const char * argv[],const char* option);
void sharedMessageHandler(QtMsgType type, const char* message);
struct VoxelDetail {
float x;
float y;

View file

@ -14,7 +14,7 @@ include_glm(${TARGET_NAME} ${ROOT_DIR})
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME} FALSE)
setup_hifi_project(${TARGET_NAME} TRUE)
# link in the shared library
include(${MACRO_DIR}/LinkHifiLibrary.cmake)

View file

@ -377,7 +377,9 @@ void attachVoxelNodeDataToNode(Node* newNode) {
int main(int argc, const char * argv[]) {
pthread_mutex_init(&::treeLock, NULL);
qInstallMsgHandler(sharedMessageHandler);
NodeList* nodeList = NodeList::createInstance(NODE_TYPE_VOXEL_SERVER, VOXEL_LISTEN_PORT);
setvbuf(stdout, NULL, _IOLBF, 0);