public static void logError(String msg) { Logger l = instance; if (l != null) { l.doLogError(msg); } }
public static void logInfo(String msg) { Logger l = instance; if (l != null) { l.doLogInfo(msg); } }
public static void logWarning(String msg) { Logger l = instance; if (l != null) { l.doLogWarning(msg); } }
protected void doLogWarning(String msg) { Logger.logWarning("(file '"+getFileDesc()+"') "+msg); }
/** * Method that will re-direct output of the logger using the specified * {@link Writer}. Null is allowed, and signifies that all the * output should be suppressed. */ public static void setOutput(Writer w) { Logger l = instance; if (l != null) { l.doSetOutput(w); } }
protected static void doDeactivate(File f, RandomAccessFile raf, FileLock lock) { if (lock != null) { try { lock.release(); } catch (Throwable t) { Logger.logError("Failed to release lock (for file '"+f+"'): "+t); } } if (raf != null) { try { raf.close(); } catch (Throwable t) { Logger.logError("Failed to close file '"+f+"':"+t); } } } }
/** * Method to set the minimum level of messages that will get logged * using currently specific logger instace. For example, if * {@link #LOG_WARNING_AND_ABOVE} is passed as the argument, warnings * and errors will be logged, but informational (INFO) messages will * not. *<p> * Note: exact functionality invoked depends on the logger instance: * sub-classes of this class may need to do mapping to some other * logging sub-system (log4j and JUL logging, for example, use their * own severity levels that while generally reasonably easy to map, * are nonetheless not one-to-one which the simple logger). */ public static void setLogLevel(int level) { Logger l = instance; if (l != null) { l.doSetLogLevel(level); } }
delay = 5L; Logger.logWarning("Need to wait for "+delay+" milliseconds; virtual clock advanced too far in the future"); long waitUntil = startTime + delay; int counter = 0;
/** * Method that will re-direct output of the logger using the specified * {@link PrintStream}. Null is allowed, and signifies that all the * output should be suppressed. *<p> * Note: exact functionality invoked depends on the logger instance. */ public static void setOutput(PrintStream str) { Logger l = instance; if (l != null) { l.doSetOutput(str); } }
protected void doLogError(String msg) { Logger.logError("(file '"+getFileDesc()+"') "+msg); }
/** * Method to set the minimum level of messages that will get logged * using currently specific logger instace. For example, if * {@link #LOG_WARNING_AND_ABOVE} is passed as the argument, warnings * and errors will be logged, but informational (INFO) messages will * not. *<p> * Note: exact functionality invoked depends on the logger instance: * sub-classes of this class may need to do mapping to some other * logging sub-system (log4j and JUL logging, for example, use their * own severity levels that while generally reasonably easy to map, * are nonetheless not one-to-one which the simple logger). */ public static void setLogLevel(int level) { Logger l = instance; if (l != null) { l.doSetLogLevel(level); } }
/** * @param nameSpaceUUID of the namespace, as defined by the * spec. UUID has 4 pre-defined "standard" name space strings * that can be passed to UUID constructor (see example below). * Note that this argument is optional; if no namespace is needed * (for example when name includes namespace prefix), null may be passed. * @param hasher Hashing algorithm to use. */ public NameBasedGenerator(UUID namespace, MessageDigest digester, UUIDType type) { _namespace = namespace; // And default digester SHA-1 if (digester == null) { } if (type == null) { String typeStr = digester.getAlgorithm(); if (typeStr.startsWith("MD5")) { type = UUIDType.NAME_BASED_MD5; } else if (typeStr.startsWith("SHA")) { type = UUIDType.NAME_BASED_SHA1; } else { // Hmmh... error out? Let's default to SHA-1, but log a warning type = UUIDType.NAME_BASED_SHA1; Logger.logWarning("Could not determine type of Digester from '"+typeStr+"'; assuming 'SHA-1' type"); } } _digester = digester; _type = type; }
/** * Method that will re-direct output of the logger using the specified * {@link Writer}. Null is allowed, and signifies that all the * output should be suppressed. */ public static void setOutput(Writer w) { Logger l = instance; if (l != null) { l.doSetOutput(w); } }
protected static void doDeactivate(File f, RandomAccessFile raf, FileLock lock) { if (lock != null) { try { lock.release(); } catch (Throwable t) { Logger.logError("Failed to release lock (for file '"+f+"'): "+t); } } if (raf != null) { try { raf.close(); } catch (Throwable t) { Logger.logError("Failed to close file '"+f+"':"+t); } } } }
public static void logWarning(String msg) { Logger l = instance; if (l != null) { l.doLogWarning(msg); } }
public static void logInfo(String msg) { Logger l = instance; if (l != null) { l.doLogInfo(msg); } }
public static void logError(String msg) { Logger l = instance; if (l != null) { l.doLogError(msg); } }