/** * Add a given logger into the hierarchical namespace. The * {@code Logger.addLogger()} factory methods call this method to add newly * created Logger. This returns false if a logger with the given name has * existed in the namespace * <p> * Note that the {@code LogManager} may only retain weak references to * registered loggers. In order to prevent {@code Logger} objects from being * unexpectedly garbage collected it is necessary for <i>applications</i> * to maintain references to them. * </p> * * @param logger * the logger to be added. * @return true if the given logger is added into the namespace * successfully, false if the given logger exists in the namespace. */ public synchronized boolean addLogger(Logger logger) { String name = logger.getName(); if (loggers.get(name) != null) { return false; } addToFamilyTree(logger, name); loggers.put(name, logger); logger.setManager(this); return true; }
public synchronized boolean addLogger(Logger logger) { String name = logger.getName(); if (loggers.get(name) != null) return false; addToFamilyTree(logger, name); loggers.put(name, logger); logger.setManager(this); return true; }
/** * Add a given logger into the hierarchical namespace. The * {@code Logger.addLogger()} factory methods call this method to add newly * created Logger. This returns false if a logger with the given name has * existed in the namespace * <p> * Note that the {@code LogManager} may only retain weak references to * registered loggers. In order to prevent {@code Logger} objects from being * unexpectedly garbage collected it is necessary for <i>applications</i> * to maintain references to them. * </p> * * @param logger * the logger to be added. * @return true if the given logger is added into the namespace * successfully, false if the given logger exists in the namespace. */ public synchronized boolean addLogger(Logger logger) { String name = logger.getName(); if (loggers.get(name) != null) { return false; } addToFamilyTree(logger, name); loggers.put(name, logger); logger.setManager(this); return true; }
/** * Add a given logger into the hierarchical namespace. The * {@code Logger.addLogger()} factory methods call this method to add newly * created Logger. This returns false if a logger with the given name has * existed in the namespace * <p> * Note that the {@code LogManager} may only retain weak references to * registered loggers. In order to prevent {@code Logger} objects from being * unexpectedly garbage collected it is necessary for <i>applications</i> * to maintain references to them. * </p> * * @param logger * the logger to be added. * @return true if the given logger is added into the namespace * successfully, false if the given logger exists in the namespace. */ public synchronized boolean addLogger(Logger logger) { String name = logger.getName(); if (loggers.get(name) != null) { return false; } addToFamilyTree(logger, name); loggers.put(name, logger); logger.setManager(this); return true; }
/** * Add a given logger into the hierarchical namespace. The * {@code Logger.addLogger()} factory methods call this method to add newly * created Logger. This returns false if a logger with the given name has * existed in the namespace * <p> * Note that the {@code LogManager} may only retain weak references to * registered loggers. In order to prevent {@code Logger} objects from being * unexpectedly garbage collected it is necessary for <i>applications</i> * to maintain references to them. * </p> * * @param logger * the logger to be added. * @return true if the given logger is added into the namespace * successfully, false if the given logger exists in the namespace. */ public synchronized boolean addLogger(Logger logger) { String name = logger.getName(); if (loggers.get(name) != null) { return false; } addToFamilyTree(logger, name); loggers.put(name, logger); logger.setManager(this); return true; }
/** * Add a given logger into the hierarchical namespace. The * {@code Logger.addLogger()} factory methods call this method to add newly * created Logger. This returns false if a logger with the given name has * existed in the namespace * <p> * Note that the {@code LogManager} may only retain weak references to * registered loggers. In order to prevent {@code Logger} objects from being * unexpectedly garbage collected it is necessary for <i>applications</i> * to maintain references to them. * </p> * * @param logger * the logger to be added. * @return true if the given logger is added into the namespace * successfully, false if the given logger exists in the namespace. */ public synchronized boolean addLogger(Logger logger) { String name = logger.getName(); if (loggers.get(name) != null) { return false; } addToFamilyTree(logger, name); loggers.put(name, logger); logger.setManager(this); return true; }
/** * Add a given logger into the hierarchical namespace. The * {@code Logger.addLogger()} factory methods call this method to add newly * created Logger. This returns false if a logger with the given name has * existed in the namespace * <p> * Note that the {@code LogManager} may only retain weak references to * registered loggers. In order to prevent {@code Logger} objects from being * unexpectedly garbage collected it is necessary for <i>applications</i> * to maintain references to them. * </p> * * @param logger * the logger to be added. * @return true if the given logger is added into the namespace * successfully, false if the given logger exists in the namespace. */ public synchronized boolean addLogger(Logger logger) { String name = logger.getName(); if (loggers.get(name) != null) { return false; } addToFamilyTree(logger, name); loggers.put(name, logger); logger.setManager(this); return true; }
/** * Add a given logger into the hierarchical namespace. The * {@code Logger.addLogger()} factory methods call this method to add newly * created Logger. This returns false if a logger with the given name has * existed in the namespace * <p> * Note that the {@code LogManager} may only retain weak references to * registered loggers. In order to prevent {@code Logger} objects from being * unexpectedly garbage collected it is necessary for <i>applications</i> * to maintain references to them. * </p> * * @param logger * the logger to be added. * @return true if the given logger is added into the namespace * successfully, false if the given logger exists in the namespace. */ public synchronized boolean addLogger(Logger logger) { String name = logger.getName(); if (loggers.get(name) != null) { return false; } addToFamilyTree(logger, name); loggers.put(name, logger); logger.setManager(this); return true; }