Type-based analysis of logarithmic amortised complexity