added trimRecords method to logInventory to manage sqlite db size