Chainline is measured from the centerline of the frame to the center of the chain.
You can measure the front chainline directly with a simple ruler. Simply hold the ruler against the seat tube or down tube and measure the distance to the middle of the chainring teeth. In the case of triple chainwheel sets, measure to the middle chainring. In the case of doubles, measure to the halfway point between the two rings.
To measure rear chainline, the easiest way is to measure the distance from the inside of the rear fork end (or the outside of the axle locknut) to the middle of the sprocket. Double this, subtract it from the over-lock-nut dimension
of the hub (or the frame spacing
, which should be the same), then divide the result in half, and you have the rear chainline.