| 174 | } |
| 175 | |
| 176 | public static synchronized LogFactory getInstance() { |
| 177 | LogFactory logFactory = INSTANCE; |
| 178 | if (logFactory == null) { |
| 179 | logFactory = new LogFactory(); |
| 180 | // Some log writers created in the later init() call may do some logging, |
| 181 | // so we store the instance before the factory was fully initialized. |
| 182 | // Any logging calls done on a non-initialized log factory and its loggers |
| 183 | // are no-op. Once the factory is fully configured, it replaces no-op |
| 184 | // loggers with the end ones. |
| 185 | INSTANCE = logFactory; |
| 186 | logFactory.init(rootDir); |
| 187 | } |
| 188 | return logFactory; |
| 189 | } |
| 190 | |
| 191 | public static Log getLog(Class<?> clazz) { |
| 192 | return getLog(clazz.getName()); |