what's $L^i_{\mu\nu}$, field strength? If so, it's "square" -what you wrote- is proportional to Killing form (which is essentially a trace); this is gauge invariant since $L$ transforms like $L\mapsto g^{-1}L g$$L\mapsto gLg^{-1} $ under gauge transformations.