Log revision (git sha)

This commit is contained in:
badaix 2021-02-14 12:54:52 +01:00
parent 2a1fde8ec7
commit 2c69844cad
8 changed files with 86 additions and 23 deletions

View file

@ -44,6 +44,7 @@
#include "common/snap_exception.hpp"
#include "common/str_compat.hpp"
#include "common/utils.hpp"
#include "common/version.hpp"
#include "metadata.hpp"
@ -55,6 +56,7 @@ using namespace std::chrono_literals;
static constexpr auto LOG_TAG = "Snapclient";
PcmDevice getPcmDevice(const std::string& player, const std::string& parameter, const std::string& soundcard)
{
#if defined(HAS_ALSA) || defined(HAS_PULSE) || defined(HAS_WASAPI)
@ -195,7 +197,7 @@ int main(int argc, char** argv)
if (versionSwitch->is_set())
{
cout << "snapclient v" << VERSION << "\n"
cout << "snapclient v" << version::code << (!version::rev().empty() ? (" (rev " + version::rev(8) + ")") : ("")) << "\n"
<< "Copyright (C) 2014-2021 BadAix (snapcast@badaix.de).\n"
<< "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n"
<< "This is free software: you are free to change and redistribute it.\n"
@ -419,6 +421,8 @@ int main(int argc, char** argv)
io_context.stop();
});
LOG(INFO, LOG_TAG) << "Snapclient v" << version::code << (!version::rev().empty() ? (", revision " + version::rev(8)) : ("")) << " started\n";
// Setup metadata handling
auto meta(metaStderr ? std::make_unique<MetaStderrAdapter>() : std::make_unique<MetadataAdapter>());
auto controller = make_shared<Controller>(io_context, settings, std::move(meta));