12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061moduleLevel=structtypet=int(* We follow LSP spec *)leterror=1letwarning=2letinfo=3letlog=4letdebug=5letto_intx=xendmoduleCallBack=structtypet={trace:string->?extra:string->string->unit;message:lvl:Level.t->message:string->unit;diagnostics:uri:Lang.LUri.File.t->version:int->Lang.Diagnostic.tlist->unit;fileProgress:uri:Lang.LUri.File.t->version:int->Progress.Info.tlist->unit;perfData:uri:Lang.LUri.File.t->version:int->Perf.t->unit;serverVersion:ServerInfo.Version.t->unit;serverStatus:ServerInfo.Status.t->unit}letdefault={trace=(fun_?extra:__->());message=(fun~lvl:_~message:_->());diagnostics=(fun~uri:_~version:__->());fileProgress=(fun~uri:_~version:__->());perfData=(fun~uri:_~version:__->());serverVersion=(fun_->());serverStatus=(fun_->())}letcb=refdefaultletsett=cb:=tendmoduleLog=structlettraced?extram=!CallBack.cb.traced?extramletfeedbackfeedback=ifnot(CList.is_emptyfeedback)then(* Put feedbacks content here? *)letextra=Nonein!CallBack.cb.trace"feedback"?extra"feedback received in non-user facing place"endmoduleReport=structletmessage~io~lvl~message=io.CallBack.message~lvl~messageletdiagnostics~io~uri~versiond=io.CallBack.diagnostics~uri~versiondletfileProgress~io~uri~versiond=io.CallBack.fileProgress~uri~versiondletperfData~io~uri~versionpd=io.CallBack.perfData~uri~versionpdletserverVersion~iovi=io.CallBack.serverVersionviletserverStatus~iost=io.CallBack.serverStatusstend