Mercurial Hosting > luan
comparison src/goodjava/logger/ThreadLocalAppender.java @ 1503:74c534de211f
use InheritableThreadLocal in ThreadLocalAppender
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 10 May 2020 23:28:16 -0600 |
parents | 219f2b937f2b |
children |
comparison
equal
deleted
inserted
replaced
1502:8a7b6b32c691 | 1503:74c534de211f |
---|---|
1 package goodjava.logger; | 1 package goodjava.logger; |
2 | 2 |
3 | 3 |
4 public final class ThreadLocalAppender implements Appender { | 4 public final class ThreadLocalAppender implements Appender { |
5 public volatile Appender defaultAppender; | 5 public volatile Appender defaultAppender; |
6 public final ThreadLocal<Appender> threadLocal = new ThreadLocal<Appender>(); | 6 public final ThreadLocal<Appender> threadLocal = new InheritableThreadLocal<Appender>(); |
7 | 7 |
8 public ThreadLocalAppender(Appender defaultAppender) { | 8 public ThreadLocalAppender(Appender defaultAppender) { |
9 this.defaultAppender = defaultAppender; | 9 this.defaultAppender = defaultAppender; |
10 } | 10 } |
11 | 11 |