Capture only AstropyWarning in the logger