Would you mind providing a default filename here?  Something like `filename || "console.txt"`, maybe?