mirror of
https://github.com/overte-org/overte.git
synced 2025-07-10 12:38:31 +02:00
Changes
The ID no longer relies on the Avatar Session ID as this changed per domain switch. The intention of this PR is to be able to group the log files easier, hence why it now relies on Interface ID instead. Additionally, when no ID is found when the interface is first launched, the ID doesn't appear in the rolled over log file. It will just appear blank.
This commit is contained in:
parent
0820eadc5b
commit
f6e22b0733
2 changed files with 10 additions and 12 deletions
|
@ -792,14 +792,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
_logger = new FileLogger(this);
|
_logger = new FileLogger(this);
|
||||||
qInstallMessageHandler(messageHandler);
|
qInstallMessageHandler(messageHandler);
|
||||||
|
|
||||||
connect(getMyAvatar().get(), &AvatarData::sessionUUIDChanged, _logger, [this] {
|
|
||||||
auto myAvatar = getMyAvatar();
|
|
||||||
if (myAvatar) {
|
|
||||||
_logger->setSessionID(myAvatar->getSessionUUID());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf");
|
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf");
|
||||||
_window->setWindowTitle("High Fidelity Interface");
|
_window->setWindowTitle("High Fidelity Interface");
|
||||||
|
|
||||||
|
@ -815,6 +807,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
// Set File Logger Session UUID
|
// Set File Logger Session UUID
|
||||||
auto avatarManager = DependencyManager::get<AvatarManager>();
|
auto avatarManager = DependencyManager::get<AvatarManager>();
|
||||||
auto myAvatar = avatarManager ? avatarManager->getMyAvatar() : nullptr;
|
auto myAvatar = avatarManager ? avatarManager->getMyAvatar() : nullptr;
|
||||||
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
|
|
||||||
|
_logger->setSessionID(accountManager->getSessionID());
|
||||||
|
|
||||||
if (steamClient) {
|
if (steamClient) {
|
||||||
qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID();
|
qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID();
|
||||||
|
@ -943,7 +938,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
connect(nodeList.data(), &NodeList::limitOfSilentDomainCheckInsReached, nodeList.data(), &NodeList::reset);
|
connect(nodeList.data(), &NodeList::limitOfSilentDomainCheckInsReached, nodeList.data(), &NodeList::reset);
|
||||||
|
|
||||||
// connect to appropriate slots on AccountManager
|
// connect to appropriate slots on AccountManager
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
// auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
|
|
||||||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||||
connect(accountManager.data(), &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog);
|
connect(accountManager.data(), &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog);
|
||||||
|
|
|
@ -42,13 +42,13 @@ private:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static const QString FILENAME_FORMAT = "hifi-log_%1_%2.txt";
|
static const QString FILENAME_FORMAT = "hifi-log%1_%2.txt";
|
||||||
static const QString DATETIME_FORMAT = "yyyy-MM-dd_hh.mm.ss";
|
static const QString DATETIME_FORMAT = "yyyy-MM-dd_hh.mm.ss";
|
||||||
static const QString LOGS_DIRECTORY = "Logs";
|
static const QString LOGS_DIRECTORY = "Logs";
|
||||||
static const QString IPADDR_WILDCARD = "[0-9]*.[0-9]*.[0-9]*.[0-9]*";
|
static const QString IPADDR_WILDCARD = "[0-9]*.[0-9]*.[0-9]*.[0-9]*";
|
||||||
static const QString DATETIME_WILDCARD = "20[0-9][0-9]-[0,1][0-9]-[0-3][0-9]_[0-2][0-9].[0-6][0-9].[0-6][0-9]";
|
static const QString DATETIME_WILDCARD = "20[0-9][0-9]-[0,1][0-9]-[0-3][0-9]_[0-2][0-9].[0-6][0-9].[0-6][0-9]";
|
||||||
static const QString FILENAME_WILDCARD = "hifi-log_" + IPADDR_WILDCARD + "_" + DATETIME_WILDCARD + ".txt";
|
static const QString FILENAME_WILDCARD = "hifi-log_" + IPADDR_WILDCARD + "_" + DATETIME_WILDCARD + ".txt";
|
||||||
QUuid SESSION_ID = QUuid("{00000000-0000-0000-0000-000000000000}");
|
QUuid SESSION_ID;
|
||||||
|
|
||||||
// Max log size is 512 KB. We send log files to our crash reporter, so we want to keep this relatively
|
// Max log size is 512 KB. We send log files to our crash reporter, so we want to keep this relatively
|
||||||
// small so it doesn't go over the 2MB zipped limit for all of the files we send.
|
// small so it doesn't go over the 2MB zipped limit for all of the files we send.
|
||||||
|
@ -64,8 +64,11 @@ QString getLogRollerFilename() {
|
||||||
QString result = FileUtils::standardPath(LOGS_DIRECTORY);
|
QString result = FileUtils::standardPath(LOGS_DIRECTORY);
|
||||||
QHostAddress clientAddress = getGuessedLocalAddress();
|
QHostAddress clientAddress = getGuessedLocalAddress();
|
||||||
QDateTime now = QDateTime::currentDateTime();
|
QDateTime now = QDateTime::currentDateTime();
|
||||||
|
QString FILE_SESSION_ID;
|
||||||
|
|
||||||
auto FILE_SESSION_ID = SESSION_ID.toString().replace("{", "").replace("}", "");
|
if (!SESSION_ID.isNull()) {
|
||||||
|
FILE_SESSION_ID = "_" + SESSION_ID.toString().replace("{", "").replace("}", "");
|
||||||
|
}
|
||||||
|
|
||||||
result.append(QString(FILENAME_FORMAT).arg(FILE_SESSION_ID, now.toString(DATETIME_FORMAT)));
|
result.append(QString(FILENAME_FORMAT).arg(FILE_SESSION_ID, now.toString(DATETIME_FORMAT)));
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue