瀏覽代碼

[typer] remove verbose spam, instead check for @:debug.typing

Simon Krajewski 1 年之前
父節點
當前提交
ad04d2d507
共有 3 個文件被更改,包括 2 次插入5 次删除
  1. 0 2
      src/typing/macroContext.ml
  2. 2 2
      src/typing/typeloadFields.ml
  3. 0 1
      src/typing/typeloadParse.ml

+ 0 - 2
src/typing/macroContext.ml

@@ -806,12 +806,10 @@ let load_macro' ctx display cpath f p =
 	fst (load_macro'' ctx.com (get_macro_context ctx) display cpath f p)
 	fst (load_macro'' ctx.com (get_macro_context ctx) display cpath f p)
 
 
 let do_call_macro com api cpath f args p =
 let do_call_macro com api cpath f args p =
-	if com.verbose then Common.log com ("Calling macro " ^ s_type_path cpath ^ "." ^ f ^ " (" ^ p.pfile ^ ":" ^ string_of_int (Lexer.get_error_line p) ^ ")");
 	let t = macro_timer com ["execution";s_type_path cpath ^ "." ^ f] in
 	let t = macro_timer com ["execution";s_type_path cpath ^ "." ^ f] in
 	incr stats.s_macros_called;
 	incr stats.s_macros_called;
 	let r = Interp.call_path (Interp.get_ctx()) ((fst cpath) @ [snd cpath]) f args api in
 	let r = Interp.call_path (Interp.get_ctx()) ((fst cpath) @ [snd cpath]) f args api in
 	t();
 	t();
-	if com.verbose then Common.log com ("Exiting macro " ^ s_type_path cpath ^ "." ^ f);
 	r
 	r
 
 
 let load_macro ctx com mctx api display cpath f p =
 let load_macro ctx com mctx api display cpath f p =

+ 2 - 2
src/typing/typeloadFields.ml

@@ -869,7 +869,7 @@ module TypeBinding = struct
 			(* type constant init fields (issue #1956) *)
 			(* type constant init fields (issue #1956) *)
 			if not !return_partial_type || (match fst e with EConst _ -> true | _ -> false) then begin
 			if not !return_partial_type || (match fst e with EConst _ -> true | _ -> false) then begin
 				r := lazy_processing (fun() -> t);
 				r := lazy_processing (fun() -> t);
-				if ctx.com.verbose then Common.log ctx.com ("Typing " ^ (if ctx.com.is_macro_context then "macro " else "") ^ s_type_path c.cl_path ^ "." ^ cf.cf_name);
+				if (Meta.has (Meta.Custom ":debug.typing") (c.cl_meta @ cf.cf_meta)) then ctx.com.print (Printf.sprintf "Typing field %s.%s\n" (s_type_path c.cl_path) cf.cf_name);
 				let e = type_var_field ctx t e fctx.is_static fctx.is_display_field p in
 				let e = type_var_field ctx t e fctx.is_static fctx.is_display_field p in
 				let maybe_run_analyzer e = match e.eexpr with
 				let maybe_run_analyzer e = match e.eexpr with
 					| TConst _ | TLocal _ | TFunction _ -> e
 					| TConst _ | TLocal _ | TFunction _ -> e
@@ -946,7 +946,7 @@ module TypeBinding = struct
 		let bind r =
 		let bind r =
 			r := lazy_processing (fun() -> t);
 			r := lazy_processing (fun() -> t);
 			incr stats.s_methods_typed;
 			incr stats.s_methods_typed;
-			if ctx.com.verbose then Common.log ctx.com ("Typing " ^ (if ctx.com.is_macro_context then "macro " else "") ^ s_type_path c.cl_path ^ "." ^ cf.cf_name);
+			if (Meta.has (Meta.Custom ":debug.typing") (c.cl_meta @ cf.cf_meta)) then ctx.com.print (Printf.sprintf "Typing method %s.%s\n" (s_type_path c.cl_path) cf.cf_name);
 			let fmode = (match cctx.abstract with
 			let fmode = (match cctx.abstract with
 				| Some _ ->
 				| Some _ ->
 					if fctx.is_abstract_member then FunMemberAbstract else FunStatic
 					if fctx.is_abstract_member then FunMemberAbstract else FunStatic

+ 0 - 1
src/typing/typeloadParse.ml

@@ -53,7 +53,6 @@ let parse_file_from_lexbuf com file p lexbuf =
 			()
 			()
 	end;
 	end;
 	t();
 	t();
-	Common.log com ("Parsed " ^ file);
 	parse_result
 	parse_result
 
 
 let parse_file_from_string com file p string =
 let parse_file_from_string com file p string =