mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-05 17:44:55 -06:00
.ide Create logger for the long term TheIDE monitoring.
git-svn-id: svn://ultimatepp.org/upp/trunk@11002 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
800375b9fe
commit
a339ab6536
7 changed files with 174 additions and 23 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
#define METHOD_NAME "Jdk::" + String(__FUNCTION__) + "(): "
|
||||
#define METHOD_NAME "Jdk::" << UPP_FUNCTION_NAME << "(): "
|
||||
|
||||
String Jdk::GetDownloadUrl()
|
||||
{
|
||||
|
|
@ -27,13 +27,13 @@ bool Jdk::Validate() const
|
|||
void Jdk::FindVersion(Host* host)
|
||||
{
|
||||
if (!Validate()) {
|
||||
LOG(METHOD_NAME + "Path to JDK is wrong or files are corrupted.");
|
||||
LoggerDebug() << METHOD_NAME << "Path to JDK is wrong or files are corrupted.";
|
||||
return;
|
||||
}
|
||||
|
||||
StringStream ss;
|
||||
if (host->Execute(GetJavacPath() + " -version", ss) != 0) {
|
||||
LOG(METHOD_NAME + "Cannot obtain version due to command execution failure.");
|
||||
LoggerDebug() << METHOD_NAME << "Cannot obtain version due to command execution failure.";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -41,25 +41,25 @@ void Jdk::FindVersion(Host* host)
|
|||
output.Replace("\n", "");
|
||||
Vector<String> splitedOutput = Split(output, " ");
|
||||
if (splitedOutput.GetCount() != 2) {
|
||||
LOG(METHOD_NAME + "Splited output is too short (" + output + ").");
|
||||
LoggerDebug() << METHOD_NAME << "Splited output is too short (" + output + ").";
|
||||
return;
|
||||
}
|
||||
|
||||
Vector<String> splitedVersion = Split(splitedOutput[1], ".");
|
||||
if (splitedVersion.GetCount() != 3) {
|
||||
LOG(METHOD_NAME + "Splited version is too short (" + output + ").");
|
||||
LoggerDebug() << METHOD_NAME << "Splited version is too short (" + output + ").";
|
||||
return;
|
||||
}
|
||||
|
||||
int major = StrInt(splitedVersion[0]);
|
||||
if (major == INT_NULL) {
|
||||
LOG(METHOD_NAME + "Major version conversion to int failed (" + splitedVersion[0] + ").");
|
||||
LoggerDebug() << METHOD_NAME << "Major version conversion to int failed (" + splitedVersion[0] + ").";
|
||||
return;
|
||||
}
|
||||
|
||||
int minor = StrInt(splitedVersion[1]);
|
||||
if (minor == INT_NULL) {
|
||||
LOG(METHOD_NAME + "Minor version conversion to int failed (" + splitedVersion[1] + ").");
|
||||
LoggerDebug() << METHOD_NAME << "Minor version conversion to int failed (" + splitedVersion[1] + ").";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue