Export logMain function for customization reasons