Explain how you would write a Python script to parse a massive log file and extract specific error codes.