本文整理匯總了Java中java.util.logging.Handler.close方法的典型用法代碼示例。如果您正苦於以下問題:Java Handler.close方法的具體用法?Java Handler.close怎麽用?Java Handler.close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.logging.Handler
的用法示例。
在下文中一共展示了Handler.close方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: close
import java.util.logging.Handler; //導入方法依賴的package包/類
/** Does its best to close provided handler. Can close handlers created by
* {@link #createDispatchHandler(java.util.logging.Handler, int)} as well.
*/
public static void close(Handler h) {
if (h == null) {
return;
}
if (h instanceof DispatchingHandler) {
((DispatchingHandler)h).doClose();
} else {
h.close();
}
}
示例2: closeLogHandlers
import java.util.logging.Handler; //導入方法依賴的package包/類
public static void closeLogHandlers(Logger log) {
if (DEBUG) {
for (Handler e: log.getHandlers()) {
e.close();
}
}
}
示例3: disable
import java.util.logging.Handler; //導入方法依賴的package包/類
private void disable() {
getProxy().getLogger().info("Disabling plugin " + getDescription().getName() + " version " + getDescription().getVersion() + " by " + getDescription().getAuthor());
try {
onDisable();
for (Handler handler : getLogger().getHandlers())
handler.close();
} catch (Exception exception) {
exception.printStackTrace();
}
getProxy().getScheduler().cancel(this);
getExecutorService().shutdownNow();
getProxy().getLogger().info("Disabled plugin " + getDescription().getName() + " version " + getDescription().getVersion() + " by " + getDescription().getAuthor());
}
示例4: freeResources
import java.util.logging.Handler; //導入方法依賴的package包/類
/**
* This function frees the logger's handlers and deletes the temp file
*/
private static void freeResources(){
configuration.closeAndDeleteFile();
//Free resources
for (Handler handle : configuration.getLogger().getHandlers()) {
handle.close();
}
}
示例5: cleanupLogger
import java.util.logging.Handler; //導入方法依賴的package包/類
/**
* Removed all the handlers of the given {@link Logger} instance.
*
* @param logger {@link Logger} to be cleaned up.
*/
private static void cleanupLogger(Logger logger) {
if (logger != null) {
Handler[] handlers = logger.getHandlers();
for (Handler handler : handlers) {
handler.close();
logger.removeHandler(handler);
}
}
}
示例6: getLogFile
import java.util.logging.Handler; //導入方法依賴的package包/類
/** Obtiene, en formato XML, el registro acumulado de la ejecución actual.
* @return Registro acumulado de la ejecución actual
* @throws IOException Si no hay registro o este no se puede leer */
public static String getLogFile() throws IOException {
if (!installed || logFile == null) {
throw new IOException("No esta instalado el manejador de fichero"); //$NON-NLS-1$
}
final Handler[] handlers = LOGGER.getHandlers();
for (final Handler h : handlers) {
if (h instanceof FileHandler) {
h.close();
LOGGER.info("Cerrado el manejador de fichero para permitir que sea procesado"); //$NON-NLS-1$
LOGGER.removeHandler(h);
}
}
final InputStream is = new FileInputStream(
new File(
logFile.replace("%h", Platform.getUserHome()) //$NON-NLS-1$
)
);
final String log = new String(AOUtil.getDataFromInputStream(is));
is.close();
LOGGER.addHandler(createFileHandler(logFile));
return log;
}
示例7: shutdown
import java.util.logging.Handler; //導入方法依賴的package包/類
private void shutdown(ActionEvent event) {
this.logger.info("Courier v" + Version.getVersion() + " shutting down!");
if (this.integration != null) {
this.integration.stop();
}
for (Handler handler : this.logger.getHandlers()) { // Close our logger handler
handler.close();
}
DiscordRPC.DiscordShutdown();
System.exit(0);
}
示例8: close
import java.util.logging.Handler; //導入方法依賴的package包/類
public void close() throws SecurityException {
for (Handler h : instances) {
h.close();
}
}
示例9: close
import java.util.logging.Handler; //導入方法依賴的package包/類
@Override
public void close() throws SecurityException {
for (Handler h : Lookup.getDefault().lookupAll(Handler.class)) {
h.close();
}
}