     if String.length(str) >= max do
       String.slice str, -max, max
     else
-      String.pad_trailing str, max
+      String.pad_leading str, max
     end
   end
 
-  def format(msg, metadata, colors) do
+  def white(count) do
+    for i <- 1..count do
+      " "
+    end
+    |> to_string
+  end
+
+  def split_blocks(msg, start, size) do
+    String.split(to_string(msg),"\n")
+      |> Enum.map(&to_string(split_blocks_splitter(&1, start, size)))
+      |> Enum.join(white(start))
+  end
+  def split_blocks_splitter(msg, start, size) do
+    if String.length(msg) > size do
+      [String.slice(msg, 0, size),"\n"] ++ [white(start),split_blocks(String.slice(msg, size, 1_024), start, size)]
+    else
+      msg
+    end
+  end
+
+  def format(msg, metadata, colors, show_time) when is_binary(msg) do
     metadata=Map.to_list(Map.new(metadata)) # get latest, to get the overwritten file/line/function
     time = Logger.Utils.format_time( elem metadata[:timestamp], 1 )
     level = String.upcase(to_string metadata[:level])

      pid
    end

    header= (
      "#{time} [#{String.pad_trailing level, 5}] [#{rpad fileline, 30} / #{String.pad_trailing pid, 10}] "
        |> color_event(metadata[:level], colors)
      )
    header = ["\r", String.pad_trailing(to_string(header), 80)]

    if is_pid(metadata[:pid]) do
      [

        msg
      ]
    else
      msg = [[IO.ANSI.format_fragment([:bright, :blue, msg], true)], IO.ANSI.reset]
      [
        header,
        msg
      ]
    end
  end
  def format(msg, metadata, colors, show_time) when is_list(msg) do
    format(to_string(msg), metadata, colors, show_time)
  end
  def format(msg, metadata, colors, show_time) do
    format(inspect(msg), metadata, colors, show_time)
  end

  defp color_event(data, level, colors) do
    [IO.ANSI.format_fragment([ Map.get(colors, level, :normal), data], true), IO.ANSI.reset]
  end


  def init(_opts) do
    {:ok, %{ colors: colors, ignore_applications: ignore_applications, ignore_levels: ignore_levels, last_t: 0 }}
  end

  def handle_event(:flush, state) do
