[PATCH v2 07/22] log: Add function to create a filter with flags