interface is reserved, so use interfaceapp as the logging tag for interface. also experiment with a macro for logging

This commit is contained in:
Seth Alves 2015-04-07 09:15:11 -07:00
parent fb607e2b26
commit fc5b442e12
22 changed files with 127 additions and 125 deletions

View file

@ -331,7 +331,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
_applicationStartupTime = startup_time;
qCDebug(interface) << "[VERSION] Build sequence: " << qPrintable(applicationVersion());
debugLog << "[VERSION] Build sequence: " << qPrintable(applicationVersion());
_bookmarks = new Bookmarks(); // Before setting up the menu
@ -529,7 +529,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
// check first run...
if (_firstRun.get()) {
qCDebug(interface) << "This is a first run...";
debugLog << "This is a first run...";
// clear the scripts, and set out script to our default scripts
clearScriptsBeforeRunning();
loadScript(DEFAULT_SCRIPTS_JS_URL);
@ -650,7 +650,7 @@ Application::~Application() {
}
void Application::initializeGL() {
qCDebug(interface) << "Created Display Window.";
debugLog << "Created Display Window.";
// initialize glut for shape drawing; Qt apparently initializes it on OS X
#ifndef __APPLE__
@ -662,22 +662,22 @@ void Application::initializeGL() {
}
#endif
qCDebug(interface) << "GL Version: " << QString((const char*) glGetString(GL_VERSION));
qCDebug(interface) << "GL Shader Language Version: " << QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION));
qCDebug(interface) << "GL Vendor: " << QString((const char*) glGetString(GL_VENDOR));
qCDebug(interface) << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
debugLog << "GL Version: " << QString((const char*) glGetString(GL_VERSION));
debugLog << "GL Shader Language Version: " << QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION));
debugLog << "GL Vendor: " << QString((const char*) glGetString(GL_VENDOR));
debugLog << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
#ifdef WIN32
GLenum err = glewInit();
if (GLEW_OK != err) {
/* Problem: glewInit failed, something is seriously wrong. */
qCDebug(interface, "Error: %s\n", glewGetErrorString(err));
qCDebug(interfaceapp, "Error: %s\n", glewGetErrorString(err));
}
qCDebug(interface, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
qCDebug(interfaceapp, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
if (wglewGetExtension("WGL_EXT_swap_control")) {
int swapInterval = wglGetSwapIntervalEXT();
qCDebug(interface, "V-Sync is %s\n", (swapInterval > 0 ? "ON" : "OFF"));
qCDebug(interfaceapp, "V-Sync is %s\n", (swapInterval > 0 ? "ON" : "OFF"));
}
#endif
@ -685,15 +685,15 @@ void Application::initializeGL() {
// TODO: Write the correct code for Linux...
/* if (wglewGetExtension("WGL_EXT_swap_control")) {
int swapInterval = wglGetSwapIntervalEXT();
qCDebug(interface, "V-Sync is %s\n", (swapInterval > 0 ? "ON" : "OFF"));
qCDebug(interfaceapp, "V-Sync is %s\n", (swapInterval > 0 ? "ON" : "OFF"));
}*/
#endif
initDisplay();
qCDebug(interface, "Initialized Display.");
qCDebug(interfaceapp, "Initialized Display.");
init();
qCDebug(interface, "init() complete.");
qCDebug(interfaceapp, "init() complete.");
// create thread for parsing of octee data independent of the main network and rendering threads
_octreeProcessor.initialize(_enableProcessOctreeThread);
@ -714,7 +714,7 @@ void Application::initializeGL() {
if (_justStarted) {
float startupTime = (float)_applicationStartupTime.elapsed() / 1000.0;
_justStarted = false;
qCDebug(interface, "Startup time: %4.2f seconds.", startupTime);
qCDebug(interfaceapp, "Startup time: %4.2f seconds.", startupTime);
}
// update before the first render
@ -1801,7 +1801,7 @@ bool Application::exportEntities(const QString& filename, float x, float y, floa
}
exportTree.writeToSVOFile(filename.toLocal8Bit().constData());
} else {
qCDebug(interface) << "No models were selected";
debugLog << "No models were selected";
return false;
}
@ -1899,7 +1899,7 @@ void Application::init() {
DependencyManager::get<AddressManager>()->loadSettings(addressLookupString);
qCDebug(interface) << "Loaded settings";
debugLog << "Loaded settings";
#ifdef __APPLE__
if (Menu::getInstance()->isOptionChecked(MenuOption::SixenseEnabled)) {
@ -2380,7 +2380,7 @@ int Application::sendNackPackets() {
void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) {
//qCDebug(interface) << ">>> inside... queryOctree()... _viewFrustum.getFieldOfView()=" << _viewFrustum.getFieldOfView();
//debugLog << ">>> inside... queryOctree()... _viewFrustum.getFieldOfView()=" << _viewFrustum.getFieldOfView();
bool wantExtraDebugging = getLogger()->extraDebugging();
// These will be the same for all servers, so we can set them up once and then reuse for each server we send to.
@ -2443,7 +2443,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
});
if (wantExtraDebugging) {
qCDebug(interface, "Servers: total %d, in view %d, unknown jurisdiction %d",
qCDebug(interfaceapp, "Servers: total %d, in view %d, unknown jurisdiction %d",
totalServers, inViewServers, unknownJurisdictionServers);
}
@ -2464,7 +2464,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
}
if (wantExtraDebugging) {
qCDebug(interface, "perServerPPS: %d perUnknownServer: %d", perServerPPS, perUnknownServer);
qCDebug(interfaceapp, "perServerPPS: %d perUnknownServer: %d", perServerPPS, perUnknownServer);
}
nodeList->eachNode([&](const SharedNodePointer& node){
@ -2483,7 +2483,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
if (jurisdictions.find(nodeUUID) == jurisdictions.end()) {
unknownView = true; // assume it's in view
if (wantExtraDebugging) {
qCDebug(interface) << "no known jurisdiction for node " << *node << ", assume it's visible.";
debugLog << "no known jurisdiction for node " << *node << ", assume it's visible.";
}
} else {
const JurisdictionMap& map = (jurisdictions)[nodeUUID];
@ -2503,7 +2503,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
}
} else {
if (wantExtraDebugging) {
qCDebug(interface) << "Jurisdiction without RootCode for node " << *node << ". That's unusual!";
debugLog << "Jurisdiction without RootCode for node " << *node << ". That's unusual!";
}
}
}
@ -2512,7 +2512,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
_octreeQuery.setMaxOctreePacketsPerSecond(perServerPPS);
} else if (unknownView) {
if (wantExtraDebugging) {
qCDebug(interface) << "no known jurisdiction for node " << *node << ", give it budget of "
debugLog << "no known jurisdiction for node " << *node << ", give it budget of "
<< perUnknownServer << " to send us jurisdiction.";
}
@ -2526,11 +2526,11 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
_octreeQuery.setCameraNearClip(0.1f);
_octreeQuery.setCameraFarClip(0.1f);
if (wantExtraDebugging) {
qCDebug(interface) << "Using 'minimal' camera position for node" << *node;
debugLog << "Using 'minimal' camera position for node" << *node;
}
} else {
if (wantExtraDebugging) {
qCDebug(interface) << "Using regular camera position for node" << *node;
debugLog << "Using regular camera position for node" << *node;
}
}
_octreeQuery.setMaxOctreePacketsPerSecond(perUnknownServer);
@ -3297,13 +3297,13 @@ void Application::updateWindowTitle(){
#ifndef WIN32
// crashes with vs2013/win32
qCDebug(interface, "Application title set to: %s", title.toStdString().c_str());
qCDebug(interfaceapp, "Application title set to: %s", title.toStdString().c_str());
#endif
_window->setWindowTitle(title);
}
void Application::clearDomainOctreeDetails() {
qCDebug(interface) << "Clearing domain octree details...";
debugLog << "Clearing domain octree details...";
// reset the environment so that we don't erroneously end up with multiple
_environment.resetToDefault();
@ -3375,7 +3375,7 @@ void Application::nodeKilled(SharedNodePointer node) {
voxelDetailsForCode(rootCode, rootDetails);
_entityServerJurisdictions.unlock();
qCDebug(interface, "model server going away...... v[%f, %f, %f, %f]",
qCDebug(interfaceapp, "model server going away...... v[%f, %f, %f, %f]",
rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s);
// Add the jurisditionDetails object to the list of "fade outs"
@ -3461,7 +3461,7 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin
if (jurisdiction->find(nodeUUID) == jurisdiction->end()) {
jurisdiction->unlock();
qCDebug(interface, "stats from new %s server... [%f, %f, %f, %f]",
qCDebug(interfaceapp, "stats from new %s server... [%f, %f, %f, %f]",
qPrintable(serverType), rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s);
// Add the jurisditionDetails object to the list of "fade outs"
@ -3707,7 +3707,7 @@ bool Application::askToSetAvatarUrl(const QString& url) {
QNetworkRequest networkRequest = QNetworkRequest(url);
networkRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
QNetworkReply* reply = networkAccessManager.get(networkRequest);
qCDebug(interface) << "Downloading avatar file at " << url;
debugLog << "Downloading avatar file at " << url;
QEventLoop loop;
QObject::connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit);
loop.exec();
@ -3756,13 +3756,13 @@ bool Application::askToSetAvatarUrl(const QString& url) {
msgBox.exec();
if (msgBox.clickedButton() == headButton) {
qCDebug(interface) << "Chose to use for head: " << url;
debugLog << "Chose to use for head: " << url;
_myAvatar->setFaceModelURL(url);
UserActivityLogger::getInstance().changedModel("head", url);
_myAvatar->sendIdentityPacket();
emit faceURLChanged(url);
} else if (msgBox.clickedButton() == bodyButton) {
qCDebug(interface) << "Chose to use for body: " << url;
debugLog << "Chose to use for body: " << url;
_myAvatar->setSkeletonModelURL(url);
// if the head is empty, reset it to the default head.
if (_myAvatar->getFaceModelURLString().isEmpty()) {
@ -3774,7 +3774,7 @@ bool Application::askToSetAvatarUrl(const QString& url) {
_myAvatar->sendIdentityPacket();
emit skeletonURLChanged(url);
} else if (msgBox.clickedButton() == bodyAndHeadButton) {
qCDebug(interface) << "Chose to use for body + head: " << url;
debugLog << "Chose to use for body + head: " << url;
_myAvatar->setFaceModelURL(QString());
_myAvatar->setSkeletonModelURL(url);
UserActivityLogger::getInstance().changedModel("skeleton", url);
@ -3782,7 +3782,7 @@ bool Application::askToSetAvatarUrl(const QString& url) {
emit faceURLChanged(QString());
emit skeletonURLChanged(url);
} else {
qCDebug(interface) << "Declined to use the avatar: " << url;
debugLog << "Declined to use the avatar: " << url;
}
return true;
}
@ -3794,10 +3794,10 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) {
reply = QMessageBox::question(getWindow(), "Run Script", message, QMessageBox::Yes|QMessageBox::No);
if (reply == QMessageBox::Yes) {
qCDebug(interface) << "Chose to run the script: " << scriptFilenameOrURL;
debugLog << "Chose to run the script: " << scriptFilenameOrURL;
loadScript(scriptFilenameOrURL);
} else {
qCDebug(interface) << "Declined to run the script: " << scriptFilenameOrURL;
debugLog << "Declined to run the script: " << scriptFilenameOrURL;
}
return true;
}
@ -3855,7 +3855,7 @@ void Application::handleScriptEngineLoaded(const QString& scriptFilename) {
}
void Application::handleScriptLoadError(const QString& scriptFilename) {
qCDebug(interface) << "Application::loadScript(), script failed to load...";
debugLog << "Application::loadScript(), script failed to load...";
QMessageBox::warning(getWindow(), "Error Loading Script", scriptFilename + " failed to load.");
}
@ -3877,7 +3877,7 @@ void Application::stopAllScripts(bool restart) {
connect(it.value(), SIGNAL(finished(const QString&)), SLOT(loadScript(const QString&)));
}
it.value()->stop();
qCDebug(interface) << "stopping script..." << it.key();
debugLog << "stopping script..." << it.key();
}
// HACK: ATM scripts cannot set/get their animation priorities, so we clear priorities
// whenever a script stops in case it happened to have been setting joint rotations.
@ -3889,7 +3889,7 @@ void Application::stopScript(const QString &scriptName) {
const QString& scriptURLString = QUrl(scriptName).toString();
if (_scriptEnginesHash.contains(scriptURLString)) {
_scriptEnginesHash.value(scriptURLString)->stop();
qCDebug(interface) << "stopping script..." << scriptName;
debugLog << "stopping script..." << scriptName;
// HACK: ATM scripts cannot set/get their animation priorities, so we clear priorities
// whenever a script stops in case it happened to have been setting joint rotations.
// TODO: expose animation priorities and provide a layered animation control system.
@ -3987,8 +3987,8 @@ void Application::domainSettingsReceived(const QJsonObject& domainSettingsObject
voxelWalletUUID = QUuid(voxelObject[VOXEL_WALLET_UUID].toString());
}
qCDebug(interface) << "Octree edits costs are" << satoshisPerVoxel << "per octree cell and" << satoshisPerMeterCubed << "per meter cubed";
qCDebug(interface) << "Destination wallet UUID for edit payments is" << voxelWalletUUID;
debugLog << "Octree edits costs are" << satoshisPerVoxel << "per octree cell and" << satoshisPerMeterCubed << "per meter cubed";
debugLog << "Destination wallet UUID for edit payments is" << voxelWalletUUID;
}
QString Application::getPreviousScriptLocation() {
@ -4153,9 +4153,9 @@ void Application::setVSyncEnabled() {
if (wglewGetExtension("WGL_EXT_swap_control")) {
wglSwapIntervalEXT(vsyncOn);
int swapInterval = wglGetSwapIntervalEXT();
qCDebug(interface, "V-Sync is %s\n", (swapInterval > 0 ? "ON" : "OFF"));
qCDebug(interfaceapp, "V-Sync is %s\n", (swapInterval > 0 ? "ON" : "OFF"));
} else {
qCDebug(interface, "V-Sync is FORCED ON on this system\n");
qCDebug(interfaceapp, "V-Sync is FORCED ON on this system\n");
}
#elif defined(Q_OS_LINUX)
// TODO: write the poper code for linux
@ -4164,13 +4164,13 @@ void Application::setVSyncEnabled() {
glxSwapIntervalEXT(vsyncOn);
int swapInterval = xglGetSwapIntervalEXT();
_isVSyncOn = swapInterval;
qCDebug(interface, "V-Sync is %s\n", (swapInterval > 0 ? "ON" : "OFF"));
qCDebug(interfaceapp, "V-Sync is %s\n", (swapInterval > 0 ? "ON" : "OFF"));
} else {
qCDebug(interface, "V-Sync is FORCED ON on this system\n");
qCDebug(interfaceapp, "V-Sync is FORCED ON on this system\n");
}
*/
#else
qCDebug(interface, "V-Sync is FORCED ON on this system\n");
qCDebug(interfaceapp, "V-Sync is FORCED ON on this system\n");
#endif
}
@ -4286,7 +4286,7 @@ void Application::notifyPacketVersionMismatch() {
void Application::checkSkeleton() {
if (_myAvatar->getSkeletonModel().isActive() && !_myAvatar->getSkeletonModel().hasSkeleton()) {
qCDebug(interface) << "MyAvatar model has no skeleton";
debugLog << "MyAvatar model has no skeleton";
QString message = "Your selected avatar body has no skeleton.\n\nThe default body will be loaded...";
QMessageBox msgBox;

View file

@ -36,7 +36,7 @@ void Bookmarks::insert(const QString& name, const QString& address) {
_bookmarks.insert(name, address);
if (contains(name)) {
qCDebug(interface) << "Added bookmark:" << name << "," << address;
debugLog << "Added bookmark:" << name << "," << address;
persistToFile();
} else {
qWarning() << "Couldn't add bookmark: " << name << "," << address;
@ -47,7 +47,7 @@ void Bookmarks::remove(const QString& name) {
_bookmarks.remove(name);
if (!contains(name)) {
qCDebug(interface) << "Deleted bookmark:" << name;
debugLog << "Deleted bookmark:" << name;
persistToFile();
} else {
qWarning() << "Couldn't delete bookmark:" << name;

View file

@ -126,8 +126,8 @@ void DatagramProcessor::processDatagrams() {
// output to the log so the user knows they got a denied connection request
// and check and signal for an access token so that we can make sure they are logged in
qCDebug(interface) << "The domain-server denied a connection request: " << reason;
qCDebug(interface) << "You may need to re-log to generate a keypair so you can provide a username signature.";
debugLog << "The domain-server denied a connection request: " << reason;
debugLog << "You may need to re-log to generate a keypair so you can provide a username signature.";
application->domainConnectionDenied(reason);
AccountManager::getInstance().checkAndSignalForAccessToken();
break;

View file

@ -50,7 +50,7 @@ Environment::~Environment() {
void Environment::init() {
if (_initialized) {
qCDebug(interface, "[ERROR] Environment is already initialized.");
qCDebug(interfaceapp, "[ERROR] Environment is already initialized.");
return;
}

View file

@ -11,4 +11,4 @@
#include "InterfaceLogging.h"
Q_LOGGING_CATEGORY(interface, "hifi.interface")
Q_LOGGING_CATEGORY(app, "hifi.interface")

View file

@ -11,4 +11,6 @@
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(interface)
Q_DECLARE_LOGGING_CATEGORY(interfaceapp)
#define debugLog qCDebug(interfaceapp)

View file

@ -79,7 +79,7 @@ void LODManager::autoAdjustLOD(float currentFPS) {
doDownShift = _fpsAverageDownWindow.getAverage() < getLODDecreaseFPS();
if (!doDownShift) {
qCDebug(interface) << "---- WE APPEAR TO BE DONE DOWN SHIFTING -----";
debugLog << "---- WE APPEAR TO BE DONE DOWN SHIFTING -----";
_isDownshifting = false;
_lastStable = now;
}
@ -103,7 +103,7 @@ void LODManager::autoAdjustLOD(float currentFPS) {
if (changed) {
if (_isDownshifting) {
// subsequent downshift
qCDebug(interface) << "adjusting LOD DOWN..."
debugLog << "adjusting LOD DOWN..."
<< "average fps for last "<< DOWN_SHIFT_WINDOW_IN_SECS <<"seconds was "
<< _fpsAverageDownWindow.getAverage()
<< "minimum is:" << getLODDecreaseFPS()
@ -111,7 +111,7 @@ void LODManager::autoAdjustLOD(float currentFPS) {
<< " NEW _octreeSizeScale=" << _octreeSizeScale;
} else {
// first downshift
qCDebug(interface) << "adjusting LOD DOWN after initial delay..."
debugLog << "adjusting LOD DOWN after initial delay..."
<< "average fps for last "<< START_DELAY_WINDOW_IN_SECS <<"seconds was "
<< _fpsAverageStartWindow.getAverage()
<< "minimum is:" << getLODDecreaseFPS()
@ -146,7 +146,7 @@ void LODManager::autoAdjustLOD(float currentFPS) {
}
if (changed) {
qCDebug(interface) << "adjusting LOD UP... average fps for last "<< UP_SHIFT_WINDOW_IN_SECS <<"seconds was "
debugLog << "adjusting LOD UP... average fps for last "<< UP_SHIFT_WINDOW_IN_SECS <<"seconds was "
<< _fpsAverageUpWindow.getAverage()
<< "upshift point is:" << getLODIncreaseFPS()
<< "elapsedSinceUpShift:" << elapsedSinceUpShift

View file

@ -52,7 +52,7 @@ Menu* Menu::getInstance() {
menuInstanceMutex.lock();
if (!_instance) {
qCDebug(interface, "First call to Menu::getInstance() - initing menu.");
qCDebug(interfaceapp, "First call to Menu::getInstance() - initing menu.");
_instance = new Menu();
}
@ -744,7 +744,7 @@ void Menu::triggerOption(const QString& menuOption) {
if (action) {
action->trigger();
} else {
qCDebug(interface) << "NULL Action for menuOption '" << menuOption << "'";
debugLog << "NULL Action for menuOption '" << menuOption << "'";
}
}
@ -988,7 +988,7 @@ void Menu::setVisibility() {
} else if (Menu::getInstance()->isOptionChecked(MenuOption::VisibleToNoOne)) {
discoverabilityManager->setDiscoverabilityMode(Discoverability::None);
} else {
qCDebug(interface) << "ERROR Menu::setVisibility() called with unrecognized value.";
debugLog << "ERROR Menu::setVisibility() called with unrecognized value.";
}
}
@ -1000,6 +1000,6 @@ void Menu::visibilityChanged(Discoverability::Mode discoverabilityMode) {
} else if (discoverabilityMode == Discoverability::None) {
setIsOptionChecked(MenuOption::VisibleToNoOne, true);
} else {
qCDebug(interface) << "ERROR Menu::visibilityChanged() called with unrecognized value.";
debugLog << "ERROR Menu::visibilityChanged() called with unrecognized value.";
}
}

View file

@ -85,7 +85,7 @@ bool ModelPackager::loadModel() {
qWarning() << QString("ModelPackager::loadModel(): Could not open FST file %1").arg(_modelFile.filePath());
return false;
}
qCDebug(interface) << "Reading FST file : " << _modelFile.filePath();
debugLog << "Reading FST file : " << _modelFile.filePath();
_mapping = FSTReader::readMapping(fst.readAll());
fst.close();
@ -104,7 +104,7 @@ bool ModelPackager::loadModel() {
qWarning() << QString("ModelPackager::loadModel(): Could not open FBX file %1").arg(_fbxInfo.filePath());
return false;
}
qCDebug(interface) << "Reading FBX file : " << _fbxInfo.filePath();
debugLog << "Reading FBX file : " << _fbxInfo.filePath();
QByteArray fbxContents = fbx.readAll();
_geometry = readFBX(fbxContents, QVariantHash());
@ -189,7 +189,7 @@ bool ModelPackager::zipModel() {
fst.write(FSTReader::writeMapping(_mapping));
fst.close();
} else {
qCDebug(interface) << "Couldn't write FST file" << fst.fileName();
debugLog << "Couldn't write FST file" << fst.fileName();
return false;
}
@ -197,7 +197,7 @@ bool ModelPackager::zipModel() {
QString saveDirPath = QFileDialog::getExistingDirectory(nullptr, "Save Model",
"", QFileDialog::ShowDirsOnly);
if (saveDirPath.isEmpty()) {
qCDebug(interface) << "Invalid directory" << saveDirPath;
debugLog << "Invalid directory" << saveDirPath;
return false;
}
@ -405,7 +405,7 @@ bool ModelPackager::copyTextures(const QString& oldDir, const QDir& newDir) {
if (!errors.isEmpty()) {
QMessageBox::warning(nullptr, "ModelPackager::copyTextures()",
"Missing textures:" + errors);
qCDebug(interface) << "ModelPackager::copyTextures():" << errors;
debugLog << "ModelPackager::copyTextures():" << errors;
return false;
}

View file

@ -182,7 +182,7 @@ void ScriptsModel::downloadFinished() {
if (!data.isEmpty()) {
finished = parseXML(data);
} else {
qCDebug(interface) << "Error: Received no data when loading remote scripts";
debugLog << "Error: Received no data when loading remote scripts";
}
}
@ -231,7 +231,7 @@ bool ScriptsModel::parseXML(QByteArray xmlFile) {
// Error handling
if (xml.hasError()) {
qCDebug(interface) << "Error loading remote scripts: " << xml.errorString();
debugLog << "Error loading remote scripts: " << xml.errorString();
return true;
}

View file

@ -140,13 +140,13 @@ void SpeechRecognizer::setEnabled(bool enabled) {
_enabled = SUCCEEDED(hr);
qCDebug(interface) << "Speech recognition" << (_enabled ? "enabled" : "enable failed");
debugLog << "Speech recognition" << (_enabled ? "enabled" : "enable failed");
} else {
_commandRecognizedNotifier->setEnabled(false);
static_cast<ISpRecoContext*>(_speechRecognizerContext)->Release();
static_cast<ISpRecognizer*>(_speechRecognizer)->Release();
qCDebug(interface) << "Speech recognition disabled";
debugLog << "Speech recognition disabled";
}
emit enabledUpdated(_enabled);
@ -208,7 +208,7 @@ void SpeechRecognizer::reloadCommands() {
}
if (FAILED(hr)) {
qCDebug(interface) << "ERROR: Didn't successfully reload speech commands";
debugLog << "ERROR: Didn't successfully reload speech commands";
}
}

View file

@ -137,43 +137,43 @@ void runTimingTests() {
float NSEC_TO_USEC = 1.0f / 1000.0f;
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "QElapsedTimer::nsecElapsed() usecs: %f", elapsedUsecs);
qCDebug(interfaceapp, "QElapsedTimer::nsecElapsed() usecs: %f", elapsedUsecs);
// Test sleep functions for accuracy
startTime.start();
QThread::msleep(1);
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "QThread::msleep(1) ms: %f", elapsedUsecs / 1000.0f);
qCDebug(interfaceapp, "QThread::msleep(1) ms: %f", elapsedUsecs / 1000.0f);
startTime.start();
QThread::sleep(1);
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "QThread::sleep(1) ms: %f", elapsedUsecs / 1000.0f);
qCDebug(interfaceapp, "QThread::sleep(1) ms: %f", elapsedUsecs / 1000.0f);
startTime.start();
usleep(1);
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "usleep(1) ms: %f", elapsedUsecs / 1000.0f);
qCDebug(interfaceapp, "usleep(1) ms: %f", elapsedUsecs / 1000.0f);
startTime.start();
usleep(10);
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "usleep(10) ms: %f", elapsedUsecs / 1000.0f);
qCDebug(interfaceapp, "usleep(10) ms: %f", elapsedUsecs / 1000.0f);
startTime.start();
usleep(100);
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "usleep(100) ms: %f", elapsedUsecs / 1000.0f);
qCDebug(interfaceapp, "usleep(100) ms: %f", elapsedUsecs / 1000.0f);
startTime.start();
usleep(1000);
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "usleep(1000) ms: %f", elapsedUsecs / 1000.0f);
qCDebug(interfaceapp, "usleep(1000) ms: %f", elapsedUsecs / 1000.0f);
startTime.start();
usleep(15000);
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "usleep(15000) ms: %f", elapsedUsecs / 1000.0f);
qCDebug(interfaceapp, "usleep(15000) ms: %f", elapsedUsecs / 1000.0f);
// Random number generation
startTime.start();
@ -181,7 +181,7 @@ void runTimingTests() {
iResults[i] = rand();
}
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "rand() stored in array usecs: %f, first result:%d", elapsedUsecs / (float) numTests, iResults[0]);
qCDebug(interfaceapp, "rand() stored in array usecs: %f, first result:%d", elapsedUsecs / (float) numTests, iResults[0]);
// Random number generation using randFloat()
startTime.start();
@ -189,7 +189,7 @@ void runTimingTests() {
fResults[i] = randFloat();
}
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "randFloat() stored in array usecs: %f, first result: %f", elapsedUsecs / (float) numTests, fResults[0]);
qCDebug(interfaceapp, "randFloat() stored in array usecs: %f, first result: %f", elapsedUsecs / (float) numTests, fResults[0]);
free(iResults);
free(fResults);
@ -201,7 +201,7 @@ void runTimingTests() {
fTest = powf(fTest, 0.5f);
}
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "powf(f, 0.5) usecs: %f", elapsedUsecs / (float) numTests);
qCDebug(interfaceapp, "powf(f, 0.5) usecs: %f", elapsedUsecs / (float) numTests);
// Vector Math
float distance;
@ -213,7 +213,7 @@ void runTimingTests() {
distance = glm::distance(pointA, pointB);
}
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "vector math usecs: %f [%f usecs total for %d tests], last result:%f",
qCDebug(interfaceapp, "vector math usecs: %f [%f usecs total for %d tests], last result:%f",
elapsedUsecs / (float) numTests, elapsedUsecs, numTests, distance);
// Vec3 test
@ -226,7 +226,7 @@ void runTimingTests() {
result = glm::dot(temp,temp);
}
elapsedUsecs = (float)startTime.nsecsElapsed() * NSEC_TO_USEC;
qCDebug(interface, "vec3 assign and dot() usecs: %f, last result:%f", elapsedUsecs / (float) numTests, result);
qCDebug(interfaceapp, "vec3 assign and dot() usecs: %f, last result:%f", elapsedUsecs / (float) numTests, result);
}
bool rayIntersectsSphere(const glm::vec3& rayStarting, const glm::vec3& rayNormalizedDirection,

View file

@ -139,7 +139,7 @@ void Avatar::simulate(float deltaTime) {
this);
break;
default:
qCDebug(interface) << "[WARNING] Avatar::simulate(): Unknown referential type.";
debugLog << "[WARNING] Avatar::simulate(): Unknown referential type.";
break;
}
}

View file

@ -26,7 +26,7 @@ ModelReferential::ModelReferential(Referential* referential, EntityTree* tree, A
referential->getExtraData().size());
if (!isValid()) {
qCDebug(interface) << "ModelReferential::copyConstructor(): Not Valid";
debugLog << "ModelReferential::copyConstructor(): Not Valid";
return;
}
@ -46,7 +46,7 @@ ModelReferential::ModelReferential(const QUuid& entityID, EntityTree* tree, Avat
{
const EntityItem* item = _tree->findEntityByID(_entityID);
if (!isValid() || item == NULL) {
qCDebug(interface) << "ModelReferential::constructor(): Not Valid";
debugLog << "ModelReferential::constructor(): Not Valid";
_isValid = false;
return;
}
@ -101,7 +101,7 @@ JointReferential::JointReferential(Referential* referential, EntityTree* tree, A
{
_type = JOINT;
if (!isValid()) {
qCDebug(interface) << "JointReferential::copyConstructor(): Not Valid";
debugLog << "JointReferential::copyConstructor(): Not Valid";
return;
}
@ -123,7 +123,7 @@ JointReferential::JointReferential(uint32_t jointIndex, const QUuid& entityID, E
const EntityItem* item = _tree->findEntityByID(_entityID);
const Model* model = getModel(item);
if (!isValid() || model == NULL || _jointIndex >= (uint32_t)(model->getJointStateCount())) {
qCDebug(interface) << "JointReferential::constructor(): Not Valid";
debugLog << "JointReferential::constructor(): Not Valid";
_isValid = false;
return;
}

View file

@ -309,7 +309,7 @@ void MyAvatar::renderDebugBodyPoints() {
glm::vec3 headPosition(getHead()->getEyePosition());
float torsoToHead = glm::length(headPosition - torsoPosition);
glm::vec3 position;
qCDebug(interface, "head-above-torso %.2f, scale = %0.2f", torsoToHead, getScale());
qCDebug(interfaceapp, "head-above-torso %.2f, scale = %0.2f", torsoToHead, getScale());
// Torso Sphere
position = torsoPosition;
@ -448,7 +448,7 @@ void MyAvatar::stopRecording() {
void MyAvatar::saveRecording(QString filename) {
if (!_recorder) {
qCDebug(interface) << "There is no recording to save";
debugLog << "There is no recording to save";
return;
}
if (QThread::currentThread() != thread()) {
@ -467,7 +467,7 @@ void MyAvatar::loadLastRecording() {
return;
}
if (!_recorder) {
qCDebug(interface) << "There is no recording to load";
debugLog << "There is no recording to load";
return;
}
if (!_player) {
@ -781,7 +781,7 @@ AttachmentData MyAvatar::loadAttachmentData(const QUrl& modelURL, const QString&
}
int MyAvatar::parseDataAtOffset(const QByteArray& packet, int offset) {
qCDebug(interface) << "Error: ignoring update packet for MyAvatar"
debugLog << "Error: ignoring update packet for MyAvatar"
<< " packetLength = " << packet.size()
<< " offset = " << offset;
// this packet is just bad, so we pretend that we unpacked it ALL
@ -1332,33 +1332,33 @@ void MyAvatar::maybeUpdateBillboard() {
void MyAvatar::increaseSize() {
if ((1.0f + SCALING_RATIO) * _targetScale < MAX_AVATAR_SCALE) {
_targetScale *= (1.0f + SCALING_RATIO);
qCDebug(interface, "Changed scale to %f", _targetScale);
qCDebug(interfaceapp, "Changed scale to %f", _targetScale);
}
}
void MyAvatar::decreaseSize() {
if (MIN_AVATAR_SCALE < (1.0f - SCALING_RATIO) * _targetScale) {
_targetScale *= (1.0f - SCALING_RATIO);
qCDebug(interface, "Changed scale to %f", _targetScale);
qCDebug(interfaceapp, "Changed scale to %f", _targetScale);
}
}
void MyAvatar::resetSize() {
_targetScale = 1.0f;
qCDebug(interface, "Reseted scale to %f", _targetScale);
qCDebug(interfaceapp, "Reseted scale to %f", _targetScale);
}
void MyAvatar::goToLocation(const glm::vec3& newPosition,
bool hasOrientation, const glm::quat& newOrientation,
bool shouldFaceLocation) {
qCDebug(interface).nospace() << "MyAvatar goToLocation - moving to " << newPosition.x << ", "
debugLog.nospace() << "MyAvatar goToLocation - moving to " << newPosition.x << ", "
<< newPosition.y << ", " << newPosition.z;
glm::vec3 shiftedPosition = newPosition;
if (hasOrientation) {
qCDebug(interface).nospace() << "MyAvatar goToLocation - new orientation is "
debugLog.nospace() << "MyAvatar goToLocation - new orientation is "
<< newOrientation.x << ", " << newOrientation.y << ", " << newOrientation.z << ", " << newOrientation.w;
// orient the user to face the target

View file

@ -177,7 +177,7 @@ bool DdeFaceTracker::isActive() const {
//private slots and methods
void DdeFaceTracker::socketErrorOccurred(QAbstractSocket::SocketError socketError) {
qCDebug(interface) << "[Error] DDE Face Tracker Socket Error: " << _udpSocket.errorString();
debugLog << "[Error] DDE Face Tracker Socket Error: " << _udpSocket.errorString();
}
void DdeFaceTracker::socketStateChanged(QAbstractSocket::SocketState socketState) {
@ -205,7 +205,7 @@ void DdeFaceTracker::socketStateChanged(QAbstractSocket::SocketState socketState
state = "Unconnected";
break;
}
qCDebug(interface) << "[Info] DDE Face Tracker Socket: " << state;
debugLog << "[Info] DDE Face Tracker Socket: " << state;
}
void DdeFaceTracker::readPendingDatagrams() {
@ -299,7 +299,7 @@ void DdeFaceTracker::decodePacket(const QByteArray& buffer) {
}
} else {
qCDebug(interface) << "[Error] DDE Face Tracker Decode Error";
debugLog << "[Error] DDE Face Tracker Decode Error";
}
_lastReceiveTimestamp = usecTimestampNow();
}

View file

@ -135,7 +135,7 @@ void Faceshift::setTCPEnabled(bool enabled) {
void Faceshift::connectSocket() {
if (_tcpEnabled) {
if (!_tcpRetryCount) {
qCDebug(interface, "Faceshift: Connecting...");
qCDebug(interfaceapp, "Faceshift: Connecting...");
}
_tcpSocket.connectToHost(_hostname.get(), FACESHIFT_PORT);
@ -145,7 +145,7 @@ void Faceshift::connectSocket() {
void Faceshift::noteConnected() {
#ifdef HAVE_FACESHIFT
qCDebug(interface, "Faceshift: Connected.");
qCDebug(interfaceapp, "Faceshift: Connected.");
// request the list of blendshape names
string message;
fsBinaryStream::encode_message(message, fsMsgSendBlendshapeNames());
@ -156,7 +156,7 @@ void Faceshift::noteConnected() {
void Faceshift::noteError(QAbstractSocket::SocketError error) {
if (!_tcpRetryCount) {
// Only spam log with fail to connect the first time, so that we can keep waiting for server
qCDebug(interface) << "Faceshift: " << _tcpSocket.errorString();
debugLog << "Faceshift: " << _tcpSocket.errorString();
}
// retry connection after a 2 second delay
if (_tcpEnabled) {

View file

@ -55,7 +55,7 @@ void MIDIManager::openDefaultPort() {
_midiInput = new RtMidiIn();
if (_midiInput->getPortCount() > 0) {
qCDebug(interface) << "MIDIManager opening port" << DEFAULT_MIDI_PORT;
debugLog << "MIDIManager opening port" << DEFAULT_MIDI_PORT;
_midiInput->openPort(DEFAULT_MIDI_PORT);
@ -64,7 +64,7 @@ void MIDIManager::openDefaultPort() {
_midiInput->setCallback(&MIDIManager::midiCallback);
} else {
qCDebug(interface) << "MIDIManager openDefaultPort called but there are no ports available.";
debugLog << "MIDIManager openDefaultPort called but there are no ports available.";
delete _midiInput;
_midiInput = NULL;
}

View file

@ -129,7 +129,7 @@ void OculusManager::connect() {
initSdk();
#endif
_calibrationState = UNCALIBRATED;
qCDebug(interface) << "Oculus SDK" << OVR_VERSION_STRING;
debugLog << "Oculus SDK" << OVR_VERSION_STRING;
if (_ovrHmd) {
if (!_isConnected) {
UserActivityLogger::getInstance().connectedDevice("hmd", "oculus");
@ -279,7 +279,7 @@ void OculusManager::calibrate(glm::vec3 position, glm::quat orientation) {
_calibrationState = WAITING_FOR_ZERO_HELD;
if (!_calibrationMessage) {
qCDebug(interface) << "Hold still to calibrate HMD";
debugLog << "Hold still to calibrate HMD";
billboard = new Text3DOverlay();
billboard->setDimensions(glm::vec2(2.0f, 1.25f));
@ -306,7 +306,7 @@ void OculusManager::calibrate(glm::vec3 position, glm::quat orientation) {
&& glm::angle(orientation * glm::inverse(_calibrationOrientation)) < CALIBRATION_ZERO_MAXIMUM_ANGLE) {
if ((usecTimestampNow() - _calibrationStartTime) > CALIBRATION_ZERO_HOLD_TIME) {
_calibrationState = CALIBRATED;
qCDebug(interface) << "HMD calibrated";
debugLog << "HMD calibrated";
Application::getInstance()->getOverlays().deleteOverlay(_calibrationMessage);
_calibrationMessage = NULL;
Application::getInstance()->resetSensors();
@ -347,7 +347,7 @@ void OculusManager::recalibrate() {
void OculusManager::abandonCalibration() {
_calibrationState = CALIBRATED;
if (_calibrationMessage) {
qCDebug(interface) << "Abandoned HMD calibration";
debugLog << "Abandoned HMD calibration";
Application::getInstance()->getOverlays().deleteOverlay(_calibrationMessage);
_calibrationMessage = NULL;
}
@ -471,7 +471,7 @@ void OculusManager::display(const glm::quat &bodyOrientation, const glm::vec3 &p
if (timerActive && timerQuery.isResultAvailable()) {
auto result = timerQuery.waitForResult();
if (result) { qCDebug(interface) << "Distortion took " << result << "ns"; };
if (result) { debugLog << "Distortion took " << result << "ns"; };
timerActive = false;
}
#endif
@ -684,7 +684,7 @@ void OculusManager::display(const glm::quat &bodyOrientation, const glm::vec3 &p
if (nonZero)
{
qCDebug(interface) << QString().sprintf("M2P Latency: Ren: %4.2fms TWrp: %4.2fms PostPresent: %4.2fms Err: %4.2fms %4.2fms",
debugLog << QString().sprintf("M2P Latency: Ren: %4.2fms TWrp: %4.2fms PostPresent: %4.2fms Err: %4.2fms %4.2fms",
latencies[0], latencies[1], latencies[2], latencies[3], latencies[4]);
}
}

View file

@ -109,9 +109,9 @@ void SixenseManager::initialize() {
}
if (_sixenseLibrary->load()){
qCDebug(interface) << "Loaded sixense library for hydra support -" << _sixenseLibrary->fileName();
debugLog << "Loaded sixense library for hydra support -" << _sixenseLibrary->fileName();
} else {
qCDebug(interface) << "Sixense library at" << _sixenseLibrary->fileName() << "failed to load."
debugLog << "Sixense library at" << _sixenseLibrary->fileName() << "failed to load."
<< "Continuing without hydra support.";
return;
}
@ -207,7 +207,7 @@ void SixenseManager::update(float deltaTime) {
hand->getPalms().push_back(newPalm);
palm = &(hand->getPalms()[hand->getNumPalms() - 1]);
palm->setSixenseID(data->controller_index);
qCDebug(interface, "Found new Sixense controller, ID %i", data->controller_index);
qCDebug(interfaceapp, "Found new Sixense controller, ID %i", data->controller_index);
}
// Disable the hands (and return to default pose) if both controllers are at base station
@ -365,11 +365,11 @@ void SixenseManager::updateCalibration(const sixenseControllerData* controllers)
glm::vec3 zAxis = glm::normalize(glm::cross(xAxis, yAxis));
xAxis = glm::normalize(glm::cross(yAxis, zAxis));
_orbRotation = glm::inverse(glm::quat_cast(glm::mat3(xAxis, yAxis, zAxis)));
qCDebug(interface, "succeess: sixense calibration");
qCDebug(interfaceapp, "succeess: sixense calibration");
}
break;
default:
qCDebug(interface, "failed: sixense calibration");
qCDebug(interfaceapp, "failed: sixense calibration");
break;
}
@ -388,7 +388,7 @@ void SixenseManager::updateCalibration(const sixenseControllerData* controllers)
if (_calibrationState == CALIBRATION_STATE_IDLE) {
float reach = glm::distance(positionLeft, positionRight);
if (reach > 2.0f * MINIMUM_ARM_REACH) {
qCDebug(interface, "started: sixense calibration");
qCDebug(interfaceapp, "started: sixense calibration");
_averageLeft = positionLeft;
_averageRight = positionRight;
_reachLeft = _averageLeft;
@ -421,7 +421,7 @@ void SixenseManager::updateCalibration(const sixenseControllerData* controllers)
_lastDistance = 0.0f;
_reachUp = 0.5f * (_reachLeft + _reachRight);
_calibrationState = CALIBRATION_STATE_Y;
qCDebug(interface, "success: sixense calibration: left");
qCDebug(interfaceapp, "success: sixense calibration: left");
}
}
else if (_calibrationState == CALIBRATION_STATE_Y) {
@ -440,7 +440,7 @@ void SixenseManager::updateCalibration(const sixenseControllerData* controllers)
_lastDistance = 0.0f;
_lockExpiry = now + LOCK_DURATION;
_calibrationState = CALIBRATION_STATE_Z;
qCDebug(interface, "success: sixense calibration: up");
qCDebug(interfaceapp, "success: sixense calibration: up");
}
}
}
@ -462,7 +462,7 @@ void SixenseManager::updateCalibration(const sixenseControllerData* controllers)
if (fabs(_lastDistance) > 0.05f * MINIMUM_ARM_REACH) {
// lock has expired so clamp the data and move on
_calibrationState = CALIBRATION_STATE_COMPLETE;
qCDebug(interface, "success: sixense calibration: forward");
qCDebug(interfaceapp, "success: sixense calibration: forward");
// TODO: it is theoretically possible to detect that the controllers have been
// accidentally switched (left hand is holding right controller) and to swap the order.
}

View file

@ -92,7 +92,7 @@ int main(int argc, const char* argv[]) {
if (clockSkewOption) {
int clockSkew = atoi(clockSkewOption);
usecTimestampNowForceClockSkew(clockSkew);
qCDebug(interface, "clockSkewOption=%s clockSkew=%d", clockSkewOption, clockSkew);
qCDebug(interfaceapp, "clockSkewOption=%s clockSkew=%d", clockSkewOption, clockSkew);
}
// Oculus initialization MUST PRECEDE OpenGL context creation.
// The nature of the Application constructor means this has to be either here,
@ -108,7 +108,7 @@ int main(int argc, const char* argv[]) {
translator.load("interface_en");
app.installTranslator(&translator);
qCDebug(interface, "Created QT Application.");
qCDebug(interfaceapp, "Created QT Application.");
exitCode = app.exec();
}
@ -116,6 +116,6 @@ int main(int argc, const char* argv[]) {
ReleaseMutex(mutex);
#endif
qCDebug(interface, "Normal exit.");
qCDebug(interfaceapp, "Normal exit.");
return exitCode;
}

View file

@ -26,7 +26,7 @@ bool Controller::computeStars(unsigned numStars, unsigned seed) {
double NSEC_TO_MSEC = 1.0 / 1000000.0;
double timeDiff = (double)startTime.nsecsElapsed() * NSEC_TO_MSEC;
qCDebug(interface) << "Total time to retile and generate stars: " << timeDiff << "msec";
debugLog << "Total time to retile and generate stars: " << timeDiff << "msec";
return true;
}