]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.logging.ui/src/org/simantics/logging/ui/handlers/SelectLoggingLevelHandler.java
Logging configuration via SCL and UI & saving to ZIP-archive
[simantics/platform.git] / bundles / org.simantics.logging.ui / src / org / simantics / logging / ui / handlers / SelectLoggingLevelHandler.java
1 package org.simantics.logging.ui.handlers;
2
3 import javax.inject.Named;
4
5 import org.eclipse.e4.core.di.annotations.Execute;
6 import org.simantics.logging.LogConfigurator;
7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory;
9
10 public class SelectLoggingLevelHandler {
11
12     private static final Logger LOGGER = LoggerFactory.getLogger(SelectLoggingLevelHandler.class);
13
14     @Execute
15     public void execute(@Named("org.simantics.logging.ui.commandparameter.selectLoggingLevel") String level) {
16         if (LOGGER.isDebugEnabled())
17             LOGGER.debug("Setting logging level to {}", level);
18         LogConfigurator.setLoggingLevel(level);
19     }
20
21 }