Subversion Repositories tpanel

Rev

Rev 367 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 367 Rev 383
Line 453... Line 453...
453
        return false;
453
        return false;
454
 
454
 
455
    if (mTemporary)
455
    if (mTemporary)
456
        localSettings_temp.logFile = file;
456
        localSettings_temp.logFile = file;
457
    else
457
    else
-
 
458
    {
458
        localSettings.logFile = file;
459
        localSettings.logFile = file;
-
 
460
        TStreamError::setLogFile(file);
-
 
461
    }
459
 
462
 
460
    mTemporary = false;
463
    mTemporary = false;
461
    return true;
464
    return true;
462
}
465
}
463
 
466
 
Line 1986... Line 1989...
1986
                localSettings.port = atoi(right.c_str());
1989
                localSettings.port = atoi(right.c_str());
1987
            else if (caseCompare(left, "LOGFILE") == 0 && !right.empty())
1990
            else if (caseCompare(left, "LOGFILE") == 0 && !right.empty())
1988
            {
1991
            {
1989
                localSettings.logFile = right;
1992
                localSettings.logFile = right;
1990
                TStreamError::setLogFileOnly(right);
1993
                TStreamError::setLogFileOnly(right);
-
 
1994
#ifdef __ANDROID__
-
 
1995
                if (std::filesystem::is_regular_file(right))
-
 
1996
                    mLogFileEnabled = true;
-
 
1997
#else
-
 
1998
                mLogFileEnabled = true;
-
 
1999
#endif
1991
            }
2000
            }
1992
            else if (caseCompare(left, "LOGLEVEL") == 0 && !right.empty())
2001
            else if (caseCompare(left, "LOGLEVEL") == 0 && !right.empty())
1993
            {
2002
            {
1994
                TStreamError::setLogLevel(right);
2003
                TStreamError::setLogLevel(right);
1995
                localSettings.logLevel = right;
2004
                localSettings.logLevel = right;
Line 2157... Line 2166...
2157
    if (TStreamError::checkFilter(HLOG_DEBUG))
2166
    if (TStreamError::checkFilter(HLOG_DEBUG))
2158
    {
2167
    {
2159
        MSG_INFO("Selected Parameters:");
2168
        MSG_INFO("Selected Parameters:");
2160
        MSG_INFO("    Path to cfg.: " << localSettings.path);
2169
        MSG_INFO("    Path to cfg.: " << localSettings.path);
2161
        MSG_INFO("    Name of cfg.: " << localSettings.name);
2170
        MSG_INFO("    Name of cfg.: " << localSettings.name);
-
 
2171
        MSG_INFO("    Logf. enabled:" << (mLogFileEnabled ? "ENABLED" : "DISABLED"));
2162
#ifndef __ANDROID__
2172
#ifdef __ANDROID__
-
 
2173
        if (mLogFileEnabled)
-
 
2174
            MSG_INFO("    Logfile:      " << localSettings.logFile);
-
 
2175
#else
2163
        MSG_INFO("    Logfile:      " << localSettings.logFile);
2176
        MSG_INFO("    Logfile:      " << localSettings.logFile);
2164
#endif
2177
#endif
2165
        MSG_INFO("    LogLevel:     " << localSettings.logLevel);
2178
        MSG_INFO("    LogLevel:     " << localSettings.logLevel);
2166
        MSG_INFO("    Long format:  " << (localSettings.longformat ? "YES" : "NO"));
2179
        MSG_INFO("    Long format:  " << (localSettings.longformat ? "YES" : "NO"));
-
 
2180
        MSG_INFO("    Logf. enabled:" << (localSettings.logFile))
2167
        MSG_INFO("    Project path: " << localSettings.project);
2181
        MSG_INFO("    Project path: " << localSettings.project);
2168
#ifndef __ANDROID__
2182
#ifndef __ANDROID__
2169
        MSG_INFO("    Show banner:  " << (localSettings.noBanner ? "NO" : "YES"));
2183
        MSG_INFO("    Show banner:  " << (localSettings.noBanner ? "NO" : "YES"));
2170
#endif
2184
#endif
2171
        MSG_INFO("    Controller:   " << localSettings.server);
2185
        MSG_INFO("    Controller:   " << localSettings.server);
Line 2219... Line 2233...
2219
 *
2233
 *
2220
 * @return A vector array containing the parts of the string \p str.
2234
 * @return A vector array containing the parts of the string \p str.
2221
 */
2235
 */
2222
vector<string> TConfig::split(const string& str, const string& seps, const bool trimEmpty)
2236
vector<string> TConfig::split(const string& str, const string& seps, const bool trimEmpty)
2223
{
2237
{
2224
    DECL_TRACER("TConfig::split(const string& str, const string& seps, const bool trimEmpty)");
2238
//    DECL_TRACER("TConfig::split(const string& str, const string& seps, const bool trimEmpty)");
2225
 
2239
 
2226
	size_t pos = 0, mark = 0;
2240
	size_t pos = 0, mark = 0;
2227
	vector<string> parts;
2241
	vector<string> parts;
2228
 
2242
 
2229
	for (auto it = str.begin(); it != str.end(); ++it)
2243
	for (auto it = str.begin(); it != str.end(); ++it)
Line 2281... Line 2295...
2281
 * less than 0 if the byte of \p str1 is bigger than the byte of \p str2\n
2295
 * less than 0 if the byte of \p str1 is bigger than the byte of \p str2\n
2282
 * grater than 0 if the byte of \p str1 is smaller than the byte of \p str2.
2296
 * grater than 0 if the byte of \p str1 is smaller than the byte of \p str2.
2283
 */
2297
 */
2284
int TConfig::caseCompare(const string& str1, const string& str2)
2298
int TConfig::caseCompare(const string& str1, const string& str2)
2285
{
2299
{
2286
    DECL_TRACER("TConfig::caseCompare(const string& str1, const string& str2)");
2300
//    DECL_TRACER("TConfig::caseCompare(const string& str1, const string& str2)");
2287
 
2301
 
2288
	size_t i = 0;
2302
	size_t i = 0;
2289
 
2303
 
2290
	if (str1.length() != str2.length())
2304
	if (str1.length() != str2.length())
2291
		return ((str1.length() < str2.length()) ? -1 : 1);
2305
		return ((str1.length() < str2.length()) ? -1 : 1);