mirror of https://github.com/Icinga/icinga2.git
Fix some whitespace
This commit is contained in:
parent
4972364f42
commit
19e160ce92
|
@ -222,7 +222,7 @@ int TroubleshootCommand::Tail(const String& file, int numLines, InfoLog& log)
|
||||||
numLines = lines;
|
numLines = lines;
|
||||||
|
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
<< "[begin: '" << file << "' line: " << numLines-lines << ']';
|
<< "\n[begin: '" << file << "' line: " << numLines-lines << ']';
|
||||||
|
|
||||||
for (int k = 0; k < numLines; k++) {
|
for (int k = 0; k < numLines; k++) {
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
|
@ -232,7 +232,7 @@ int TroubleshootCommand::Tail(const String& file, int numLines, InfoLog& log)
|
||||||
text.close();
|
text.close();
|
||||||
|
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
<< "[end: '" << file << "' line: " << lines << ']';
|
<< "[end: '" << file << "' line: " << lines << "]\n";
|
||||||
|
|
||||||
return numLines;
|
return numLines;
|
||||||
}
|
}
|
||||||
|
@ -306,7 +306,7 @@ bool TroubleshootCommand::PrintCrashReports(InfoLog& log)
|
||||||
if (int const * err = boost::get_error_info<errinfo_win32_error>(ex)) {
|
if (int const * err = boost::get_error_info<errinfo_win32_error>(ex)) {
|
||||||
if (*err != 3) {//Error code for path does not exist
|
if (*err != 3) {//Error code for path does not exist
|
||||||
InfoLogLine(log, LogWarning)
|
InfoLogLine(log, LogWarning)
|
||||||
<< Application::GetLocalStateDir() << "/log/icinga2/crash/ does not exist";
|
<< Application::GetLocalStateDir() << "/log/icinga2/crash/ does not exist\n";
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ bool TroubleshootCommand::PrintCrashReports(InfoLog& log)
|
||||||
#else
|
#else
|
||||||
catch (...) {
|
catch (...) {
|
||||||
InfoLogLine(log, LogWarning) << "Error printing crash reports.\n"
|
InfoLogLine(log, LogWarning) << "Error printing crash reports.\n"
|
||||||
<< "Does " << Application::GetLocalStateDir() << "/log/icinga2/crash/ exist?";
|
<< "Does " << Application::GetLocalStateDir() << "/log/icinga2/crash/ exist?\n";
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -327,12 +327,14 @@ bool TroubleshootCommand::PrintCrashReports(InfoLog& log)
|
||||||
|
|
||||||
if (!bestTimestamp)
|
if (!bestTimestamp)
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
<< "No crash logs found in " << Application::GetLocalStateDir().CStr() << "/log/icinga2/crash/";
|
<< "No crash logs found in " << Application::GetLocalStateDir().CStr() << "/log/icinga2/crash/\n";
|
||||||
else {
|
else {
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
<< "Latest crash report is from " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", Utility::GetTime())
|
<< "Latest crash report is from " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", Utility::GetTime())
|
||||||
<< "\nFile: " << bestFilename;
|
<< "\nFile: " << bestFilename;
|
||||||
Tail(bestFilename, 20, log);
|
Tail(bestFilename, 20, log);
|
||||||
|
InfoLogLine(log)
|
||||||
|
<< "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -348,7 +350,7 @@ bool TroubleshootCommand::PrintConf(InfoLog& log, const String& path)
|
||||||
std::string line;
|
std::string line;
|
||||||
|
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
<< "[begin: '" << path << "']";
|
<< "\n[begin: '" << path << "']";
|
||||||
|
|
||||||
while (std::getline(text, line)) {
|
while (std::getline(text, line)) {
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
|
@ -441,7 +443,7 @@ void TroubleshootCommand::CheckObjectFile(const String& objectfile, InfoLog& log
|
||||||
|
|
||||||
//Print objects with count
|
//Print objects with count
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
<< "Found the " << countTotal << " objects:"
|
<< "Found the " << countTotal << " objects:\n"
|
||||||
<< "\tType" << std::string(typeL-4, ' ') << " : Count";
|
<< "\tType" << std::string(typeL-4, ' ') << " : Count";
|
||||||
|
|
||||||
BOOST_FOREACH(const Dictionary::Pair& kv, type_count) {
|
BOOST_FOREACH(const Dictionary::Pair& kv, type_count) {
|
||||||
|
@ -449,13 +451,18 @@ void TroubleshootCommand::CheckObjectFile(const String& objectfile, InfoLog& log
|
||||||
<< '\t' << kv.first << std::string(typeL - kv.first.GetLength(), ' ')
|
<< '\t' << kv.first << std::string(typeL - kv.first.GetLength(), ' ')
|
||||||
<< " : " << kv.second;
|
<< " : " << kv.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InfoLogLine(log)
|
||||||
|
<< "";
|
||||||
|
|
||||||
|
TroubleshootCommand::PrintObjectOrigin(log, configs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TroubleshootCommand::PrintLoggers(InfoLog& log, Dictionary::Ptr& logs)
|
void TroubleshootCommand::PrintLoggers(InfoLog& log, Dictionary::Ptr& logs)
|
||||||
{
|
{
|
||||||
if (!logs->GetLength()) {
|
if (!logs->GetLength()) {
|
||||||
InfoLogLine(log, LogWarning)
|
InfoLogLine(log, LogWarning)
|
||||||
<< "No loggers found, check whether you enabled any logging features";
|
<< "No loggers found, check whether you enabled any logging features\n";
|
||||||
} else {
|
} else {
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
<< "Getting the last 20 lines of " << logs->GetLength() << " FileLogger objects.";
|
<< "Getting the last 20 lines of " << logs->GetLength() << " FileLogger objects.";
|
||||||
|
@ -467,16 +474,16 @@ void TroubleshootCommand::PrintLoggers(InfoLog& log, Dictionary::Ptr& logs)
|
||||||
|
|
||||||
if (!Tail(kv.second, 20, log)) {
|
if (!Tail(kv.second, 20, log)) {
|
||||||
InfoLogLine(log, LogWarning)
|
InfoLogLine(log, LogWarning)
|
||||||
<< kv.second << " either does not exist or is empty";
|
<< kv.second << " either does not exist or is empty\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TroubleshootCommand::PrintConfig(InfoLog& log, const std::set<String>& configSet, const String::SizeType& countTotal)
|
void TroubleshootCommand::PrintObjectOrigin(InfoLog& log, const std::set<String>& configSet)
|
||||||
{
|
{
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
<< countTotal << " objects in total, originating from these files:";
|
<< "The objects origins are:";
|
||||||
|
|
||||||
for (std::set<String>::iterator it = configSet.begin(); it != configSet.end(); it++) {
|
for (std::set<String>::iterator it = configSet.begin(); it != configSet.end(); it++) {
|
||||||
InfoLogLine(log)
|
InfoLogLine(log)
|
||||||
|
|
|
@ -63,7 +63,7 @@ private:
|
||||||
static void CheckObjectFile(const String& objectfile, InfoLog& log, const bool print,
|
static void CheckObjectFile(const String& objectfile, InfoLog& log, const bool print,
|
||||||
Dictionary::Ptr& logs, std::set<String>& configs);
|
Dictionary::Ptr& logs, std::set<String>& configs);
|
||||||
static void PrintLoggers(InfoLog& log, Dictionary::Ptr& logs);
|
static void PrintLoggers(InfoLog& log, Dictionary::Ptr& logs);
|
||||||
static void PrintConfig(InfoLog& log, const std::set<String>& configSet, const String::SizeType& countTotal);
|
static void PrintObjectOrigin(InfoLog& log, const std::set<String>& configSet);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue