]> gerrit.simantics Code Review - simantics/platform.git/blob
27473f182736b46a69af479c382257c0957f1cea
[simantics/platform.git] /
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 }