public OSvTerminal() { super(true); setAnsiSupported(true); try { if (stty == null) { sttyClass = Class.forName("com.cloudius.util.Stty"); stty = sttyClass.newInstance(); } } catch (Exception e) { Log.warn("Failed to load com.cloudius.util.Stty", e); } }
public void flush() throws IOException { Log.trace("Flushing history"); if (!file.exists()) { File dir = file.getParentFile(); if (!dir.exists() && !dir.mkdirs()) { Log.warn("Failed to create directory: ", dir); } if (!file.createNewFile()) { Log.warn("Failed to create file: ", file); } } PrintStream out = new PrintStream(new BufferedOutputStream(new FileOutputStream(file))); try { for (Entry entry : this) { out.println(entry.value()); } } finally { out.close(); } }
public void purge() throws IOException { Log.trace("Purging history"); clear(); if (!file.delete()) { Log.warn("Failed to delete history file: ", file); } } }
protected void loadKeys(String appName, URL inputrcUrl) { keys = keyMaps.get(KeyMap.EMACS); try { InputStream input = inputrcUrl.openStream(); try { loadKeys(input, appName); Log.debug("Loaded user configuration: ", inputrcUrl); } finally { try { input.close(); } catch (IOException e) { // Ignore } } } catch (IOException e) { if (inputrcUrl.getProtocol().equals("file")) { File file = new File(inputrcUrl.getPath()); if (file.exists()) { Log.warn("Unable to read user configuration: ", inputrcUrl, e); } } else { Log.warn("Unable to read user configuration: ", inputrcUrl, e); } } }
private static synchronized void runTasks() { Log.debug("Running all shutdown-hook tasks"); // Iterate through copy of tasks list for (Task task : tasks.toArray(new Task[tasks.size()])) { Log.debug("Running task: ", task); try { task.run(); } catch (Throwable e) { Log.warn("Task failed", e); } } tasks.clear(); }
private static Properties initProperties() { URL url = determineUrl(); Properties props = new Properties(); try { loadProperties(url, props); } catch (FileNotFoundException e) { // debug here and no stack trace, as this can happen normally if default jline.rc file is missing Log.debug("Unable to read configuration: ", e.toString()); } catch (IOException e) { Log.warn("Unable to read configuration from: ", url, e); } return props; }
Log.warn("Unable to parse user configuration: ", e);
public OSvTerminal() { super(true); setAnsiSupported(true); try { if (stty == null) { sttyClass = Class.forName("com.cloudius.util.Stty"); stty = sttyClass.newInstance(); } } catch (Exception e) { Log.warn("Failed to load com.cloudius.util.Stty", e); } }
private void touch() { Put put = new Put(startIdBytes); put.add(DominoConst.TRANSACTION_META_FAMILY, DominoConst.TRANSACTION_TS, startId, DominoConst.tsToBytes(System.currentTimeMillis())); try { metaTable.put(put); } catch (IOException ioe) { Log.warn("Error reporting liveness: {}", ioe.toString()); } }
public void flush() throws IOException { Log.trace("Flushing history"); if (!file.exists()) { File dir = file.getParentFile(); if (!dir.exists() && !dir.mkdirs()) { Log.warn("Failed to create directory: ", dir); } if (!file.createNewFile()) { Log.warn("Failed to create file: ", file); } } PrintStream out = new PrintStream(new BufferedOutputStream(new FileOutputStream(file))); try { for (Entry entry : this) { out.println(entry.value()); } } finally { out.close(); } }
protected void loadKeys(String appName, URL inputrcUrl) { keys = keyMaps.get(KeyMap.EMACS); try { InputStream input = inputrcUrl.openStream(); try { loadKeys(input, appName); Log.debug("Loaded user configuration: ", inputrcUrl); } finally { try { input.close(); } catch (IOException e) { // Ignore } } } catch (IOException e) { if (inputrcUrl.getProtocol().equals("file")) { File file = new File(inputrcUrl.getPath()); if (file.exists()) { Log.warn("Unable to read user configuration: ", inputrcUrl, e); } } else { Log.warn("Unable to read user configuration: ", inputrcUrl, e); } } }
public void purge() throws IOException { Log.trace("Purging history"); clear(); if (!file.delete()) { Log.warn("Failed to delete history file: ", file); } } }
private static synchronized void runTasks() { Log.debug("Running all shutdown-hook tasks"); // Iterate through copy of tasks list for (Task task : tasks.toArray(new Task[tasks.size()])) { Log.debug("Running task: ", task); try { task.run(); } catch (Throwable e) { Log.warn("Task failed", e); } } tasks.clear(); }
public ContainerBucketFillHandler addFilledBucket(ItemStack filledBucket) { FluidStack containedFluid = FluidUtil.getFluidContained(filledBucket); if (containedFluid != null) { buckets.add(Pair.of(containedFluid.copy(), filledBucket.copy())); } else { Log.warn("Item %s is not a filled bucket", filledBucket); } return this; }
@Override public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { final IModel model = loadBaseModel(state, format, bakedTextureGetter); IBlockState blockState = null; if (defaultBlockState.isPresent()) { final Block defaultBlock = Block.REGISTRY.getObject(defaultBlockState.get()); if (defaultBlock != Blocks.AIR) { blockState = defaultBlock.getDefaultState(); if (!(blockState instanceof IExtendedBlockState) || !((IExtendedBlockState)blockState).getUnlistedNames().contains(EvalModelState.PROPERTY)) { Log.warn("State %s does not contain eval state property", blockState); } } else { Log.warn("Can't find default block: %s", defaultBlockState.get()); } } final IVarExpander expander = evaluatorFactory.createExpander(); return new BakedEvalExpandModel(model, state, format, bakedTextureGetter, blockState, expander); }
private static Properties initProperties() { URL url = determineUrl(); Properties props = new Properties(); try { loadProperties(url, props); } catch (FileNotFoundException e) { // debug here and no stack trace, as this can happen normally if default jline.rc file is missing Log.debug("Unable to read configuration: ", e.toString()); } catch (IOException e) { Log.warn("Unable to read configuration from: ", url, e); } return props; }
Log.warn("Unable to parse user configuration: ", e);
public ITileFilterContainer getFilterContainer(MessageContext ctx) { if (ctx.side == Side.SERVER) { if (ctx.getServerHandler().player.openContainer instanceof ContainerFilter) { final TileEntity tileEntity = ((ContainerFilter) ctx.getServerHandler().player.openContainer).getTileEntity(); if (tileEntity == null || !tileEntity.getPos().equals(getPos())) { Log.warn("Player " + ctx.getServerHandler().player.getName() + " tried to manipulate a filter while another gui was open!"); return null; } else { if (tileEntity instanceof ITileFilterContainer) { return (ITileFilterContainer) tileEntity; } } } } return null; }