     quote do
       match _ do
         {:ok, conn} = Sugar.Controller.not_found var!(conn)
-        Lager.info "#{conn.method} #{conn.status} /#{Enum.join conn.path_info, "/"}"
+        log conn
         {:ok, conn}
+      end
+
+      defp log(conn) do
+        if loaded? Config do
+          config = apply(Config, :config, [])
+          if config[:log] do
+            Lager.info "#{conn.method} #{conn.status} /#{Enum.join conn.path_info, "/"}"
+          end
+        end
+      end
+
+      defp loaded?(module) do
+        is_tuple :code.is_loaded(module)
       end
     end
   end

  defmacro get(route, controller, action) do
    quote do
      get unquote(route), do: unquote(
        quote do 
          binding = binding()
          {:ok, conn} = apply(unquote(controller), unquote(action), [var!(conn), Keyword.delete(binding, :conn)])
          Lager.info "GET #{conn.status} /#{Enum.join conn.path_info, "/"}"
          {:ok, conn}
        end
      )
    end
  end

  defmacro put(route, controller, action) do
    quote do
      put unquote(route), do: unquote(
        build_match controller, action
      )
    end
  end
