A logistic GLM will fit linear functions of covariates on the scale of the link function (linear predictor), whereas a GAM would fit smooth functions on this scale. If you aren't sure if you need a GAM, you could just fit the GAM, check if the size of the basis expansion for each smooth was sufficiently large (via k.check() or gam.check()), and rely on the smoothing parameters to shrink away unnecessary wiggliness.
If you want a formal test for the necessity or otherwise of the wiggly bits of the smooth over a purely linear effect, you can do this with a modification to the null space for the default thin plate spline basis.
# pseudo code
m <- gam(y ~ x + s(x, m = c(2, 0), bs = "tp"),
data = foo, method = "REML", family = binomial())
where we fit a linear term in x plus a smooth function of x, but we have modified the basis for the smooth so that it no longer includes linear functions in the span of the basis. This modification is done by m = c(2, 0), which indicates we want the usual second order derivative penalty but with a 0 size null space (the span of functions that aren't affected by the penalty because they have 0 second derivative). With this specification, the output from summary() will give a test for the necessity of the wiggliness provided by the smooth over the linear effect estimated by the linear term.