use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.
the class LogLevelSelectorPanel method refreshAllLoggersPanel.
/**
* This method makes remote calls and should not be called in the event thread!
* @throws AcsJCORBAProblemEx In case of ORB / network failure or if remote process is unresponsive or unreachable.
*/
private void refreshAllLoggersPanel() throws AcsJCORBAProblemEx {
try {
LogLevels defaultLevels = logConf.get_default_logLevels();
int acsLevel = defaultLevels.minLogLevelLocal;
try {
LogTypeHelper logTypeLocal = LogTypeHelper.fromAcsCoreLevel(AcsLogLevelDefinition.fromInteger(acsLevel));
allLocalCB.setSelectedIndex(logTypeLocal.ordinal());
model.setCommonLocalLevel(logTypeLocal);
} catch (AcsJIllegalArgumentEx e) {
logger.warning("Unexpected log level " + acsLevel + " obtained as default minLogLevelLocal.");
}
acsLevel = defaultLevels.minLogLevel;
try {
LogTypeHelper logTypeGlobal = LogTypeHelper.fromAcsCoreLevel(AcsLogLevelDefinition.fromInteger(acsLevel));
allGlobalCB.setSelectedIndex(logTypeGlobal.ordinal());
model.setCommonGlobalLevel(logTypeGlobal);
} catch (AcsJIllegalArgumentEx e) {
logger.warning("Unexpected log level " + acsLevel + " obtained as default minLogLevel.");
}
} catch (SystemException ex) {
AcsJCORBAProblemEx ex2 = new AcsJCORBAProblemEx(ex);
ex2.setInfo("Failed to retrieve logger names or levels.");
throw ex2;
}
}
use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.
the class AcsAlarmSystem method set_logLevels.
/**
* Sets log levels for a particular named logger. If levels.useDefault is
* true, then the logger will be reset to using default levels; otherwise it
* will use the supplied local and remote levels.
*/
public void set_logLevels(String logger_name, LogLevels levels) throws LoggerDoesNotExistEx, IllegalLogLevelsEx {
if (levels.useDefault) {
logConfig.clearNamedLoggerConfig(logger_name);
} else {
try {
UnnamedLogger config = AcsLogLevelDefinition.createXsdLogLevelsFromIdl(levels);
logConfig.setNamedLoggerConfig(logger_name, config);
} catch (AcsJIllegalArgumentEx ex) {
//throw ex.toIllegalArgumentEx();
IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
throw ille;
}
}
}
use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.
the class AcsAlarmSystem method set_default_logLevels.
/**
* Sets the log levels of the default logging configuration. These levels
* are used by all loggers that have not been configured individually.
*/
public void set_default_logLevels(LogLevels levels) throws IllegalLogLevelsEx {
try {
logConfig.setDefaultMinLogLevel(AcsLogLevelDefinition.fromInteger(levels.minLogLevel));
logConfig.setDefaultMinLogLevelLocal(AcsLogLevelDefinition.fromInteger(levels.minLogLevelLocal));
} catch (AcsJIllegalArgumentEx ex) {
//throw ex.toIllegalArgumentEx();
IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
throw ille;
}
}
use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.
the class AcsContainer method set_default_logLevels.
/**
* Sets the log levels of the default logging configuration. These levels
* are used by all loggers that have not been configured individually.
*/
public void set_default_logLevels(LogLevels levels) throws IllegalLogLevelsEx {
tryToWaitForContainerStart();
try {
logConfig.setDefaultMinLogLevel(AcsLogLevelDefinition.fromInteger(levels.minLogLevel));
logConfig.setDefaultMinLogLevelLocal(AcsLogLevelDefinition.fromInteger(levels.minLogLevelLocal));
} catch (AcsJIllegalArgumentEx ex) {
//throw ex.toIllegalArgumentEx();
IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
throw ille;
}
}
use of alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx in project ACS by ACS-Community.
the class AcsContainer method set_logLevels.
/**
* Sets log levels for a particular named logger. If levels.useDefault is
* true, then the logger will be reset to using default levels; otherwise it
* will use the supplied local and remote levels.
*/
public void set_logLevels(String logger_name, LogLevels levels) throws LoggerDoesNotExistEx, IllegalLogLevelsEx {
tryToWaitForContainerStart();
if (levels.useDefault) {
logConfig.clearNamedLoggerConfig(logger_name);
} else {
try {
UnnamedLogger config = AcsLogLevelDefinition.createXsdLogLevelsFromIdl(levels);
logConfig.setNamedLoggerConfig(logger_name, config);
} catch (AcsJIllegalArgumentEx ex) {
//throw ex.toIllegalArgumentEx();
IllegalLogLevelsEx ille = new IllegalLogLevelsEx(ex.getErrorDesc());
throw ille;
}
}
}
Aggregations