Because I change needles for a special project long before the current needle needs replacing, etc., here's how I handle it:
When you put a new needle in the machine, show the needle size and type (ball point, sharp, etc.) on a 3/4" piece of masking tape. Apply that tape to your machine right on the front in full view. Then you always know which needle you're using.
When it's time to change the needle for a new project(e.g., embroidery to denim) note on the tape for the removed needle about how many hours you've sewn with it (you should only go 8 hours maximum), and fold that tape around the top of the needle you've removed.
Make a new tape for the needle going into the machine.
When the needles have reached their 8 hours, I keep them in a separate spot as they're just great for perforating paper pieces for new projects.