new log handle+severity, fix memleaks in plugins