|
4 | 4 | import java.util.List; |
5 | 5 | import java.util.Map; |
6 | 6 | import java.util.concurrent.ConcurrentHashMap; |
| 7 | +import java.util.logging.Level; |
| 8 | +import java.util.logging.Logger; |
7 | 9 |
|
8 | | -import io.vertx.core.impl.logging.Logger; |
9 | 10 | import picoded.core.conv.ConvertJSON; |
10 | 11 | import picoded.core.struct.GenericConvertHashMap; |
11 | 12 | import picoded.core.struct.GenericConvertList; |
@@ -147,25 +148,27 @@ public CoreStack getProviderStack(String name) { |
147 | 148 | return cache; |
148 | 149 | } |
149 | 150 |
|
150 | | - // Log the setup |
151 | | - String type = providerConfig.getString("type"); |
152 | | - LOGGER.info("Setting DStack provider backend : "+name+" ("+type+")"); |
153 | | - |
154 | 151 | // Cache not found, get config to initialize a new stack |
155 | 152 | GenericConvertMap<String, Object> providerConfig = getStackConfig(name); |
156 | 153 | if (providerConfig == null) { |
| 154 | + LOGGER.log(Level.SEVERE, "Unknown provider name, config not found : " + name); |
157 | 155 | throw new IllegalArgumentException("Unknown provider name, config not found : " + name); |
158 | 156 | } |
159 | 157 |
|
| 158 | + // Log the setup |
| 159 | + String type = providerConfig.getString("type"); |
| 160 | + LOGGER.info("Setting DStack provider backend : " + name + " (" + type + ")"); |
| 161 | + |
160 | 162 | // Initialization of stack and store into cache |
161 | 163 | try { |
162 | 164 | cache = initStack(type, providerConfig); |
163 | | - } catch(Exception e) { |
| 165 | + } catch (Exception e) { |
164 | 166 | // Log the error, as this is easily missed into an API error |
165 | | - LOGGER.error("Error while setting DStack provider : "+name+" ("+type+")", e); |
| 167 | + LOGGER.log(Level.SEVERE, "Error while setting DStack provider : " + name + " (" + type |
| 168 | + + ")", e); |
166 | 169 | throw new RuntimeException(e); |
167 | 170 | } |
168 | | - |
| 171 | + |
169 | 172 | // Save it into cache |
170 | 173 | providerStackMap.put(name, cache); |
171 | 174 |
|
|
0 commit comments