If you're using the last release or newer, ggplot now has tidy eval, so you can use rlang::sym and unquote in regular aes:
library(ggplot2)
set.seed(47)
df <- data.frame(y = runif(1:10), "log(foo)" = 1:10, check.names = FALSE)
varname <- "log(foo)"
ggplot(df, aes(x = !!sym(varname), y = y)) + geom_point()

With the old-style system, you can do something similar with aes_:
ggplot(df, aes_(x = as.name(varname), y = ~y)) + geom_point()
With aes_string, as @yutannihilation said, you'd need to insert quotes to inhibit evaluation, e.g.
ggplot(df, aes_string(x = sprintf("`%s`", varname), y = "y")) + geom_point()
From the docs (?aes_), though:
Life cycle
All these functions are soft-deprecated. Please use tidy evaluation idioms instead (see the quasiquotation section in aes() documentation).