What is Null and Residual deviance in logistic regression

@machinelearnbot 

Above we can see that two deviances NULL and Residual. Here Value of NULL deviance can be read as 43,86 on 31 degrees of freedom and Residual deviance as 21.4 on 29 degrees of freedom. Deviance is a measure of goodness of fit of a model. Higher numbers always indicates bad fit. The null deviance shows how well the response variable is predicted by a model that includes only the intercept (grand mean) where as residual with inclusion of independent variables.