This commit is contained in:
Igor I
2025-08-25 09:04:23 +05:00
parent 9d750fc6a3
commit 930ae8eafb
5 changed files with 74 additions and 3 deletions

View File

@ -0,0 +1,21 @@
package logging;
public class LoggerFactory {
public static Logger createLogger(Class<?> clazz) {
// Тут выбираешь реализацию по флагу/условию
//if (isAndroid()) {
return new AndroidLogger(clazz);
//} else {
// return new SLF4JLogger(clazz);
//}
}
private static boolean isAndroid() {
try {
Class.forName("android.os.Build");
return true;
} catch (ClassNotFoundException e) {
return false;
}
}
}