mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
auto generation of initial config file (#271)
* - remove feature of using multiple config files for automaticly start other hyperion instances - add auto config file creation - tune service files * add auto path creation for initial default config * debian package: rename service to hyperiond remove copy of config file
This commit is contained in:
@@ -4,10 +4,16 @@
|
||||
|
||||
namespace FileUtils {
|
||||
|
||||
std::string getBaseName( std::string sourceFile)
|
||||
QString getBaseName( QString sourceFile)
|
||||
{
|
||||
QFileInfo fi( sourceFile.c_str() );
|
||||
return fi.fileName().toStdString();
|
||||
QFileInfo fi( sourceFile );
|
||||
return fi.fileName();
|
||||
}
|
||||
|
||||
QString getDirName( QString sourceFile)
|
||||
{
|
||||
QFileInfo fi( sourceFile );
|
||||
return fi.path();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -126,16 +126,16 @@ void Logger::Message(LogLevel level, const char* sourceFile, const char* func, u
|
||||
vsnprintf (msg, max_msg_length, fmt, args);
|
||||
va_end (args);
|
||||
|
||||
std::string location;
|
||||
std::string function(func);
|
||||
QString location;
|
||||
QString function(func);
|
||||
if ( level == Logger::DEBUG )
|
||||
{
|
||||
location = "<" + FileUtils::getBaseName(sourceFile) + ":" + QString::number(line).toStdString()+":"+ function + "()> ";
|
||||
location = "<" + FileUtils::getBaseName(sourceFile) + ":" + QString::number(line)+":"+ function + "()> ";
|
||||
}
|
||||
|
||||
std::cout
|
||||
<< "[" << _appname << " " << _name << "] <"
|
||||
<< LogLevelStrings[level] << "> " << location << msg
|
||||
<< LogLevelStrings[level] << "> " << location.toStdString() << msg
|
||||
<< std::endl;
|
||||
|
||||
if ( _syslogEnabled && level >= Logger::WARNING )
|
||||
|
@@ -62,7 +62,7 @@ void Profiler::TimerStart(const std::string timerName, const char* sourceFile, c
|
||||
else
|
||||
{
|
||||
_logger->Message(Logger::DEBUG, sourceFile, func, line, "ERROR timer '%s' started in multiple locations. First occurence %s:%d:%s()",
|
||||
timerName.c_str(), FileUtils::getBaseName(ret.first->second.sourceFile).c_str(), ret.first->second.line, ret.first->second.func );
|
||||
timerName.c_str(), FileUtils::getBaseName(ret.first->second.sourceFile).toLocal8Bit().constData(), ret.first->second.line, ret.first->second.func );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -79,7 +79,7 @@ void Profiler::TimerGetTime(const std::string timerName, const char* sourceFile,
|
||||
if (ret != GlobalProfilerMap.end())
|
||||
{
|
||||
_logger->Message(Logger::DEBUG, sourceFile, func, line, "timer '%s' started at %s:%d:%s() took %f s execution time until here", timerName.c_str(),
|
||||
FileUtils::getBaseName(ret->second.sourceFile).c_str(), ret->second.line, ret->second.func, getClockDelta(ret->second.startTime) );
|
||||
FileUtils::getBaseName(ret->second.sourceFile).toLocal8Bit().constData(), ret->second.line, ret->second.func, getClockDelta(ret->second.startTime) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user