Add generic functions logOnce and dontRepeat