@Test public void currentThrowExceptionIfNoLogContext() throws Exception { try { SmartLog.current(); } catch (Exception e) { Assertions.assertThat(e).hasMessage("Loggable context is absent"); } }
@Nonnull public static LogContext current() { final Deque<LogContext> contextQueue = CONTEXTS.get(); if (!contextQueue.isEmpty()) { return contextQueue.peek(); } else { throw new RuntimeException("Loggable context is absent"); } }
SmartLog { @Nonnull public static LogContext current() { final Deque<LogContext> contextQueue = CONTEXTS.get(); if (!contextQueue.isEmpty()) { return contextQueue.peek(); } else { throw new RuntimeException("Loggable context is absent"); } } }
SmartLog { @Nonnull public static LogContext current() { final Deque<LogContext> contextQueue = CONTEXTS.get(); if (!contextQueue.isEmpty()) { return contextQueue.peek(); } else { throw new RuntimeException("Loggable context is absent"); } }  }
SmartLog { @Nonnull public static LogContext current() { final Deque<LogContext> contextQueue = CONTEXTS.get(); if (!contextQueue.isEmpty()) { return contextQueue.peek(); } else { throw new RuntimeException("Loggable context is absent"); } }  @Nonnull static LogContext start(@Nonnull final Output output); @Nonnull static LogContext start(@Nonnull final Object loggableObject); @Nonnull static LogContext start(@Nonnull final Output output, @Nullable final Object loggableObject); static void finish(); @Nonnull static LogContext current(); @Nonnull static LogContext output(@Nonnull final Output output); @Nonnull static LogContext level(@Nonnull final LogLevel level); @Nonnull static LogContext format(@Nonnull final Format format); @Nonnull static LogContext title(@Nonnull final String title); @Nonnull static LogContext title(@Nonnull final String format, final Object... args); @Nonnull static LogContext attach(@Nonnull final String name, @Nullable final Object value); @Nonnull static LogContext throwable(@Nonnull final Throwable newThrowable); @Nonnull static LogContext trace(final String msg); @Nonnull static LogContext trace(final String format, final Object... args); @Nonnull static LogContext trace(@Nonnull final TraceFlag flag, @Nonnull final String msg); @Nonnull static LogContext trace(@Nonnull final TraceFlag flag, @Nonnull final String msg, @Nonnull final Object... args); @Nonnull static LogContext result(final Object result); @Nonnull static LogContext result(final String description, final Object... args); @Nonnull static LogContext result(final LogLevel level, final Object result); @Nonnull static LogContext result(final LogLevel level, final String description, final Object... args); @Nonnull static LogContext result(final LogLevel level, final Throwable throwable, final String description); @Nonnull static LogContext result(final LogLevel level, final Throwable throwable, final String description, final Object... args); }
SmartLog { @Nonnull public static LogContext current() { final Deque<LogContext> contextQueue = CONTEXTS.get(); if (!contextQueue.isEmpty()) { return contextQueue.peek(); } else { throw new RuntimeException("Loggable context is absent"); } }  @Nonnull static LogContext start(@Nonnull final Output output); @Nonnull static LogContext start(@Nonnull final Object loggableObject); @Nonnull static LogContext start(@Nonnull final Output output, @Nullable final Object loggableObject); static void finish(); @Nonnull static LogContext current(); @Nonnull static LogContext output(@Nonnull final Output output); @Nonnull static LogContext level(@Nonnull final LogLevel level); @Nonnull static LogContext format(@Nonnull final Format format); @Nonnull static LogContext title(@Nonnull final String title); @Nonnull static LogContext title(@Nonnull final String format, final Object... args); @Nonnull static LogContext attach(@Nonnull final String name, @Nullable final Object value); @Nonnull static LogContext throwable(@Nonnull final Throwable newThrowable); @Nonnull static LogContext trace(final String msg); @Nonnull static LogContext trace(final String format, final Object... args); @Nonnull static LogContext trace(@Nonnull final TraceFlag flag, @Nonnull final String msg); @Nonnull static LogContext trace(@Nonnull final TraceFlag flag, @Nonnull final String msg, @Nonnull final Object... args); @Nonnull static LogContext result(final Object result); @Nonnull static LogContext result(final String description, final Object... args); @Nonnull static LogContext result(final LogLevel level, final Object result); @Nonnull static LogContext result(final LogLevel level, final String description, final Object... args); @Nonnull static LogContext result(final LogLevel level, final Throwable throwable, final String description); @Nonnull static LogContext result(final LogLevel level, final Throwable throwable, final String description, final Object... args);  }