Search in sources :

Example 1 with LogLevels

use of alma.Logging.LoggingConfigurablePackage.LogLevels in project ACS by ACS-Community.

the class DALImpl method get_default_logLevels.

/**
	 * Gets the log levels of the default logging configuration. These levels
	 * are used by all loggers that have not been configured individually.
	 */
public LogLevels get_default_logLevels() {
    LogLevels logLevels = new LogLevels();
    logLevels.useDefault = false;
    logLevels.minLogLevel = (short) logConfig.getDefaultMinLogLevel().value;
    logLevels.minLogLevelLocal = (short) logConfig.getDefaultMinLogLevelLocal().value;
    return logLevels;
}
Also used : LogLevels(alma.Logging.LoggingConfigurablePackage.LogLevels)

Example 2 with LogLevels

use of alma.Logging.LoggingConfigurablePackage.LogLevels in project ACS by ACS-Community.

the class ManagerProxyImpl method get_logLevels.

/**
	 * Gets log levels for a particular named logger. If the returned field
	 * LogLevels.useDefault is true, then the logger uses the default levels,
	 * see get_default_logLevels(); otherwise the returned local and remote
	 * levels apply.
	 */
public LogLevels get_logLevels(String logger_name) {
    pendingRequests.incrementAndGet();
    try {
        LogConfig logConfig = ClientLogManager.getAcsLogManager().getLogConfig();
        UnnamedLogger levels = logConfig.getNamedLoggerConfig(logger_name);
        boolean useDefault = !logConfig.hasCustomConfig(logger_name);
        LogLevels ret = AcsLogLevelDefinition.createIdlLogLevelsFromXsd(useDefault, levels);
        return ret;
    } finally {
        pendingRequests.decrementAndGet();
    }
}
Also used : UnnamedLogger(alma.maci.loggingconfig.UnnamedLogger) LogConfig(alma.acs.logging.config.LogConfig) LogLevels(alma.Logging.LoggingConfigurablePackage.LogLevels)

Example 3 with LogLevels

use of alma.Logging.LoggingConfigurablePackage.LogLevels in project ACS by ACS-Community.

the class ManagerProxyImpl method get_default_logLevels.

/* ************************ LoggingConfigurable ************************ */
/**
	 * Gets the log levels of the default logging configuration. These levels
	 * are used by all loggers that have not been configured individually.
	 */
public LogLevels get_default_logLevels() {
    pendingRequests.incrementAndGet();
    try {
        LogConfig logConfig = ClientLogManager.getAcsLogManager().getLogConfig();
        LogLevels logLevels = new LogLevels();
        logLevels.useDefault = false;
        logLevels.minLogLevel = (short) logConfig.getDefaultMinLogLevel().value;
        logLevels.minLogLevelLocal = (short) logConfig.getDefaultMinLogLevelLocal().value;
        return logLevels;
    } finally {
        pendingRequests.decrementAndGet();
    }
}
Also used : LogConfig(alma.acs.logging.config.LogConfig) LogLevels(alma.Logging.LoggingConfigurablePackage.LogLevels)

Example 4 with LogLevels

use of alma.Logging.LoggingConfigurablePackage.LogLevels in project ACS by ACS-Community.

the class LaserComponent method get_default_logLevels.

/**
	 * Gets the log levels of the default logging configuration. These levels
	 * are used by all loggers that have not been configured individually.
	 */
public LogLevels get_default_logLevels() {
    LogLevels logLevels = new LogLevels();
    logLevels.useDefault = false;
    logLevels.minLogLevel = (short) logConfig.getDefaultMinLogLevel().value;
    logLevels.minLogLevelLocal = (short) logConfig.getDefaultMinLogLevelLocal().value;
    return logLevels;
}
Also used : LogLevels(alma.Logging.LoggingConfigurablePackage.LogLevels)

Example 5 with LogLevels

use of alma.Logging.LoggingConfigurablePackage.LogLevels 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;
    }
}
Also used : AcsJCORBAProblemEx(alma.ACSErrTypeCommon.wrappers.AcsJCORBAProblemEx) SystemException(org.omg.CORBA.SystemException) LogTypeHelper(com.cosylab.logging.engine.log.LogTypeHelper) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx) LogLevels(alma.Logging.LoggingConfigurablePackage.LogLevels)

Aggregations

LogLevels (alma.Logging.LoggingConfigurablePackage.LogLevels)15 UnnamedLogger (alma.maci.loggingconfig.UnnamedLogger)6 SystemException (org.omg.CORBA.SystemException)3 AcsJCORBAProblemEx (alma.ACSErrTypeCommon.wrappers.AcsJCORBAProblemEx)2 LogConfig (alma.acs.logging.config.LogConfig)2 LogTypeHelper (com.cosylab.logging.engine.log.LogTypeHelper)2 AcsJIllegalArgumentEx (alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)1 LoggerDoesNotExistEx (alma.Logging.LoggerDoesNotExistEx)1 LogLvlSelNotSupportedException (alma.acs.gui.loglevel.LogLvlSelNotSupportedException)1 LockableUnnamedLogger (alma.acs.logging.config.LogConfig.LockableUnnamedLogger)1 ArrayList (java.util.ArrayList)1