     [Integer.to_string(yy), ?-, pad2(mm), ?-, pad2(dd)]
   end
 
-  defp pad3(int) when int < 10,  do: [?0, ?0, Integer.to_string(int)]
+  defp pad3(int) when int < 10, do: [?0, ?0, Integer.to_string(int)]
   defp pad3(int) when int < 100, do: [?0, Integer.to_string(int)]
   defp pad3(int), do: Integer.to_string(int)
 

    for part <- Regex.split(regex, str, on: [:head, :tail], trim: true) do
      case part do
        "$" <> code -> compile_code(String.to_atom(code))
        _           -> part
      end
    end
  end

  defp compile_code(key) when key in @valid_patterns, do: key
  defp compile_code(key) when is_atom(key) do
    raise(ArgumentError, message: "$#{key} is an invalid format pattern.")
  end

  @doc """

  defp metadata(pid) when is_pid(pid) do
    :erlang.pid_to_list(pid)
  end

  defp metadata(ref) when is_reference(ref) do
    '#Ref' ++ rest = :erlang.ref_to_list(ref)
    rest
  end

  defp metadata(atom) when is_atom(atom) do
    case Atom.to_string(atom) do
      "Elixir." <> rest -> rest
