/** * Return a logger named according to the name parameter using the * statically bound {@link ILoggerFactory} instance. * * @param name * The name of the logger. * @return logger */ public static Logger getLogger(String name) { ILoggerFactory iLoggerFactory = getILoggerFactory(); return iLoggerFactory.getLogger(name); }
/** * Return a logger named according to the name parameter using the * statically bound {@link ILoggerFactory} instance. * * @param name * The name of the logger. * @return logger */ public static Logger getLogger(String name) { ILoggerFactory iLoggerFactory = getILoggerFactory(); return iLoggerFactory.getLogger(name); }
@Deprecated // @see docs/design/slf4j.md public Logger getLogger(String name) { // TODO: Make it always return org.slf4j.LoggerFactory.getLogger(...). return loggerFactory.getLogger(name); }
@Inject public RawScriptingContainerProvider(final Injector injector, final ScriptingContainerDelegate delegate) { this.delegate = delegate; this.logger = injector.getInstance(ILoggerFactory.class).getLogger("init"); }
@Override public Log getLog( Class loggingClass ) { return new Slf4jLog( loggerFactory.getLogger( loggingClass.getName() ) ); }
@Deprecated // @see docs/design/slf4j.md public Logger getLogger(Class<?> name) { // TODO: Make it always return org.slf4j.LoggerFactory.getLogger(...). return loggerFactory.getLogger(name.getName()); }
@Override public Log getLog( String context ) { return new Slf4jLog( loggerFactory.getLogger( context ) ); } }
private EmbulkEmbed(ConfigSource systemConfig, Injector injector) { this.injector = injector; this.logger = injector.getInstance(org.slf4j.ILoggerFactory.class).getLogger(EmbulkEmbed.class.getName()); this.bulkLoader = injector.getInstance(BulkLoader.class); this.guessExecutor = injector.getInstance(GuessExecutor.class); this.previewExecutor = injector.getInstance(PreviewExecutor.class); }
public Logger getLoggerForComponent( String role ) { return new Slf4jLogger( loggerFactory.getLogger( role ) ); }
@Override public Logger getLogger(String s) { _count.incrementAndGet(); return _loggerFactory.getLogger(s); }
/** * The logger name for a component with a non-null hint is <code>role.hint</code>. * <b>Warning</b>: this does not conform to logger name as class name convention. * (and what about <code>null</code> and <code>default</code> hint equivalence?) */ public Logger getLoggerForComponent( String role, String hint ) { return ( null == hint ? getLoggerForComponent( role ) : new Slf4jLogger( loggerFactory.getLogger( role + '.' + hint ) ) ); }
slf4jLogger = slf4jLoggerFactory.getLogger( this.getClass().getName() );
@Inject public ScriptingContainerProvider(Injector injector, @ForSystemConfig ConfigSource systemConfig) { // use_global_ruby_runtime is valid only when it's guaranteed that just one Injector is // instantiated in this JVM. this.useGlobalRubyRuntime = systemConfig.get(boolean.class, "use_global_ruby_runtime", false); this.initializer = JRubyInitializer.of( injector, injector.getInstance(ILoggerFactory.class).getLogger("init"), systemConfig.get(String.class, "gem_home", null), systemConfig.get(String.class, "jruby_use_default_embulk_gem_home", "false").equals("true"), // TODO get jruby-home from systemConfig to call jruby.container.setHomeDirectory systemConfig.get(List.class, "jruby_load_path", null), systemConfig.get(List.class, "jruby_classpath", new ArrayList()), systemConfig.get(List.class, "jruby_command_line_options", null), systemConfig.get(String.class, "jruby_global_bundler_plugin_source_directory", null)); }
@Test public void testCaching() throws Exception { CountingLoggerFactory loggerFactory = new CountingLoggerFactory(); final ILoggerFactory cachedFactory = new CachedLoggerFactory(loggerFactory); ExecutorService executorService = Executors.newFixedThreadPool(5); CountDownLatch startRace = new CountDownLatch(1); CountDownLatch stopRace = new CountDownLatch(5); for (int i = 0; i < 5; i++) { executorService.submit(() -> { try { startRace.await(); cachedFactory.getLogger("com.linkedin.parseq.Task"); stopRace.countDown(); } catch (Exception e) { Assert.fail(); } } ); } // start race startRace.countDown(); assertTrue(stopRace.await(5000, TimeUnit.MILLISECONDS)); Assert.assertEquals(loggerFactory.getCount(), 1); }
public PlanContext(final Engine engine, final Executor taskExecutor, final DelayedExecutor timerExecutor, final ILoggerFactory loggerFactory, final Logger allLogger, final Logger rootLogger, final String planClass, Task<?> root, final int maxRelationshipsPerTrace, final PlanDeactivationListener planDeactivationListener, PlanCompletionListener planCompletionListener, final SerialExecutor.TaskQueue<PrioritizableRunnable> taskQueue, final boolean drainSerialExecutorQueue, ExecutionMonitor executionMonitor) { _id = IdGenerator.getNextId(); _root = root; _relationshipsBuilder = new TraceBuilder(maxRelationshipsPerTrace, planClass, _id); _engine = engine; _taskExecutor = new SerialExecutor(taskExecutor, new CancellingPlanExceptionHandler(root), () -> { try { planDeactivationListener.onPlanDeactivated(PlanContext.this); } catch (Throwable t) { LOG.error("Failed to notify deactivation listener " + planDeactivationListener, t); } }, taskQueue, drainSerialExecutorQueue, executionMonitor); _timerScheduler = timerExecutor; final Logger planLogger = loggerFactory.getLogger(Engine.LOGGER_BASE + ":planClass=" + planClass); _taskLogger = new TaskLogger(_id, root.getId(), allLogger, rootLogger, planLogger); _planClass = planClass; _planCompletionListener = planCompletionListener; _pending = new AtomicInteger(1); _root.addListener(p -> done()); }
jruby.runScriptlet("Embulk::Logger"), "new", injector.getInstance(ILoggerFactory.class).getLogger("ruby")));
slf4jLogger = slf4jLoggerFactory.getLogger( this.getClass().getName() );
/** * Return a logger named according to the name parameter using the statically * bound {@link ILoggerFactory} instance. * * @param name The name of the logger. * @return logger */ public static Logger getLogger(String name) { ILoggerFactory iLoggerFactory = getILoggerFactory(); return iLoggerFactory.getLogger(name); }
public org.slf4j.Logger get(InternalContext context, Dependency<?> dependency, boolean linked) { InjectionPoint injectionPoint = dependency.getInjectionPoint(); if (injectionPoint != null) { return loggerFactory().getLogger(injectionPoint.getMember().getDeclaringClass().getName()); } return loggerFactory().getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME); }