本文整理汇总了Java中org.cubeengine.logscribe.LogFactory类的典型用法代码示例。如果您正苦于以下问题:Java LogFactory类的具体用法?Java LogFactory怎么用?Java LogFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogFactory类属于org.cubeengine.logscribe包,在下文中一共展示了LogFactory类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSetup
import org.cubeengine.logscribe.LogFactory; //导入依赖的package包/类
@Listener
public void onSetup(GamePreInitializationEvent event)
{
cm.getProviders().getExceptionHandler().addHandler(new RolesExceptionHandler(i18n));
this.permLogger = factory.getLog(LogFactory.class, "Permissions");
ThreadFactory threadFactory = mm.getThreadFactory(Roles.class);
this.permLogger.addTarget(
new AsyncFileTarget.Builder(LoggingUtil.getLogFile(fm, "Permissions").toPath(),
LoggingUtil.getFileFormat(false, true)
).setAppend(true).setCycler(LoggingUtil.getCycler()).setThreadFactory(threadFactory).build());
Optional<PermissionService> previous = Sponge.getServiceManager().provide(PermissionService.class);
Sponge.getServiceManager().setProvider(plugin.getInstance().get(), PermissionService.class, service);
if (previous.isPresent())
{
if (!previous.get().getClass().getName().equals(RolesPermissionService.class.getName()))
{
this.service.getLog().info("Replaced existing Permission Service: {}", previous.get().getClass().getName());
}
}
}
示例2: ApiServer
import org.cubeengine.logscribe.LogFactory; //导入依赖的package包/类
@Inject
public ApiServer(LogFactory logFactory, FileManager fm, ModuleManager mm)
{
this.logger = mm.getLoggerFor(ApiServer.class);
this.moduleFolder = mm.getPathFor(ApiServer.class);
this.tf = mm.getThreadFactory(this.getClass());
this.log = logFactory.getLog(ApiServer.class, "WebAPI");
this.mm = mm;
this.log.addTarget(
new AsyncFileTarget.Builder(LoggingUtil.getLogFile(fm, "WebAPI").toPath(),
LoggingUtil.getFileFormat(true, true)
).setAppend(true).setCycler(LoggingUtil.getCycler()).setThreadFactory(tf).build());
// TODO this.log.addTarget(new LogProxyTarget(logFactory.getParent()));
try
{
this.bindAddress.set(InetAddress.getLocalHost());
}
catch (UnknownHostException ignored)
{
this.log.warn("Failed to get the localhost!");
}
}
示例3: MySQLDatabase
import org.cubeengine.logscribe.LogFactory; //导入依赖的package包/类
@Inject
public MySQLDatabase(Reflector reflector, ModuleManager mm, FileManager fm, LogFactory logFactory)
{
this.mm = mm;
this.mm.registerBinding(Database.class, this);
File pluginFolder = mm.getBasePath();
// Disable HikariPool Debug ConsoleSpam
((Logger)LogManager.getLogger(HikariPool.class)).setLevel(Level.INFO);
((Logger)LogManager.getLogger("com.zaxxer.hikari.pool.PoolBase")).setLevel(Level.INFO); // really? now pkg-private
((Logger)LogManager.getLogger(HikariConfig.class)).setLevel(Level.INFO);
// Setting up Logger...
this.logger = mm.getLoggerFor(Database.class);
AsyncFileTarget target =
new AsyncFileTarget.Builder(LoggingUtil.getLogFile(fm, "Database").toPath(),
LoggingUtil.getFileFormat(true, false)
).setAppend(true).setCycler(LoggingUtil.getCycler()).setThreadFactory(threadFactory).build();
target.setLevel(LogLevel.DEBUG);
logger.addTarget(target);
LogTarget parentTarget = logger.addDelegate(logFactory.getLog(LogFactory.class));
parentTarget.appendFilter(new PrefixFilter("[DB] "));
parentTarget.setLevel(LogLevel.INFO);
this.config = reflector.load(MySQLDatabaseConfiguration.class, new File(pluginFolder, "database.yml"));
}