Statusline format can be passed as parameter.

Change function SyntasticStatuslineFlag to receive the format as
parameter(optional), if no parameter is passed use the g:syntastic_stl_format.
This is useful when you want to use different highlights for erros and
warnings:

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag("%W{[Warn: %fw(%w)]}")}
set statusline+=%#errormsg#
set statusline+=%{SyntasticStatuslineFlag("%E{[Err: %fe(%e)]}")}
set statusline+=%*