what is the best way to measure for shaft length
The correct way to fit for the correct length, is to use face decals, and hit different length clubs determining which length creates the most consistent pattern, on irons and woods.
https://www.golfworks.com/oversized-iron-impact-decals/p/gw1041v/
https://www.golfworks.com/oversized-driver-impact-decals/p/gw1042v/
As far as marking shafts to cut to a specific length, there are a couple different ways.
https://www.golfworks.com/maltby-bench-top-club-length-ruler/p/ma2010/
https://www.golfworks.com/the-golfworks-48-aluminum-golf-club-ruler/p/rul48/
Shaft length and lie angle are inseparable. For a given lie angle; there is, for each golfer, an optimal shaft length. The one tried and true method is to hit golf balls and, honestly, assess the quality of the shots produced. The proper length is the one that produces the most consistent, and desired, result.