427 // |
427 // |
428 // This method must delegate to the LogManager implementation to |
428 // This method must delegate to the LogManager implementation to |
429 // add a new Logger or return the one that has been added previously |
429 // add a new Logger or return the one that has been added previously |
430 // as a LogManager subclass may override the addLogger, getLogger, |
430 // as a LogManager subclass may override the addLogger, getLogger, |
431 // readConfiguration, and other methods. |
431 // readConfiguration, and other methods. |
432 Logger demandLogger(String name, String resourceBundleName) { |
432 Logger demandLogger(String name, String resourceBundleName, Class<?> caller) { |
433 Logger result = getLogger(name); |
433 Logger result = getLogger(name); |
434 if (result == null) { |
434 if (result == null) { |
435 // only allocate the new logger once |
435 // only allocate the new logger once |
436 Logger newLogger = new Logger(name, resourceBundleName); |
436 Logger newLogger = new Logger(name, resourceBundleName, caller); |
437 do { |
437 do { |
438 if (addLogger(newLogger)) { |
438 if (addLogger(newLogger)) { |
439 // We successfully added the new Logger that we |
439 // We successfully added the new Logger that we |
440 // created above so return it without refetching. |
440 // created above so return it without refetching. |
441 return newLogger; |
441 return newLogger; |
513 } |
513 } |
514 |
514 |
515 Logger demandLogger(String name, String resourceBundleName) { |
515 Logger demandLogger(String name, String resourceBundleName) { |
516 // a LogManager subclass may have its own implementation to add and |
516 // a LogManager subclass may have its own implementation to add and |
517 // get a Logger. So delegate to the LogManager to do the work. |
517 // get a Logger. So delegate to the LogManager to do the work. |
518 return manager.demandLogger(name, resourceBundleName); |
518 return manager.demandLogger(name, resourceBundleName, null); |
519 } |
519 } |
520 |
520 |
521 synchronized Logger findLogger(String name) { |
521 synchronized Logger findLogger(String name) { |
522 LoggerWeakRef ref = namedLoggers.get(name); |
522 LoggerWeakRef ref = namedLoggers.get(name); |
523 if (ref == null) { |
523 if (ref == null) { |