mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:10:06 +00:00
Merge pull request #450 from dpaulat/feature/add-build-number
Add build number and increase log file write frequency
This commit is contained in:
commit
fb675811dd
4 changed files with 14 additions and 10 deletions
|
|
@ -55,8 +55,9 @@ int main(int argc, char* argv[])
|
||||||
auto& logManager = scwx::qt::manager::LogManager::Instance();
|
auto& logManager = scwx::qt::manager::LogManager::Instance();
|
||||||
logManager.Initialize();
|
logManager.Initialize();
|
||||||
|
|
||||||
logger_->info("Supercell Wx v{} ({})",
|
logger_->info("Supercell Wx v{}.{} ({})",
|
||||||
scwx::qt::main::kVersionString_,
|
scwx::qt::main::kVersionString_,
|
||||||
|
scwx::qt::main::kBuildNumber_,
|
||||||
scwx::qt::main::kCommitString_);
|
scwx::qt::main::kCommitString_);
|
||||||
|
|
||||||
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
|
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,12 @@
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace scwx
|
namespace scwx::qt::main
|
||||||
{
|
|
||||||
namespace qt
|
|
||||||
{
|
|
||||||
namespace main
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const std::uint32_t kBuildNumber_ {${build_number}u};
|
||||||
const std::string kCommitString_ {"${commit_string}"};
|
const std::string kCommitString_ {"${commit_string}"};
|
||||||
const std::uint16_t kCopyrightYear_ {${copyright_year}u};
|
const std::uint16_t kCopyrightYear_ {${copyright_year}u};
|
||||||
const std::string kVersionString_ {"${version_string}"};
|
const std::string kVersionString_ {"${version_string}"};
|
||||||
|
|
||||||
} // namespace main
|
} // namespace scwx::qt::main
|
||||||
} // namespace qt
|
|
||||||
} // namespace scwx
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,9 @@ AboutDialog::AboutDialog(QWidget* parent) :
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->versionLabel->setText(
|
ui->versionLabel->setText(
|
||||||
tr("Version %1").arg(QString::fromStdString(main::kVersionString_)));
|
tr("Version %1 (Build %2)")
|
||||||
|
.arg(QString::fromStdString(main::kVersionString_))
|
||||||
|
.arg(main::kBuildNumber_));
|
||||||
ui->revisionLabel->setText(
|
ui->revisionLabel->setText(
|
||||||
tr("Git Revision <a href=\"%1\">%2</a>")
|
tr("Git Revision <a href=\"%1\">%2</a>")
|
||||||
.arg(repositoryUrl)
|
.arg(repositoryUrl)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,12 @@ static std::vector<std::shared_ptr<spdlog::sinks::sink>> extraSinks_ {};
|
||||||
void Initialize()
|
void Initialize()
|
||||||
{
|
{
|
||||||
spdlog::set_pattern(logPattern_);
|
spdlog::set_pattern(logPattern_);
|
||||||
|
|
||||||
|
// Periodically flush every 3 seconds
|
||||||
|
spdlog::flush_every(std::chrono::seconds(3));
|
||||||
|
|
||||||
|
// Flush whenever logging info or higher
|
||||||
|
spdlog::flush_on(spdlog::level::level_enum::info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddFileSink(const std::string& baseFilename)
|
void AddFileSink(const std::string& baseFilename)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue