2
0
Эх сурвалжийг харах

Remove (or make verbose only) various debug prints.

bruvzg 2 жил өмнө
parent
commit
09465f3fe6

+ 0 - 4
core/io/pck_packer.cpp

@@ -252,10 +252,6 @@ Error PCKPacker::flush(bool p_verbose) {
 		}
 	}
 
-	if (p_verbose) {
-		printf("\n");
-	}
-
 	file.unref();
 	memdelete_arr(buf);
 

+ 0 - 1
drivers/vulkan/rendering_device_vulkan.cpp

@@ -1825,7 +1825,6 @@ RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const T
 		}
 
 		if (p_format.usage_bits & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT && !(flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)) {
-			printf("vkformat: %x\n", image_create_info.format);
 			ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as depth-stencil attachment.");
 		}
 

+ 6 - 5
editor/editor_run.cpp

@@ -261,11 +261,12 @@ Error EditorRun::run(const String &p_scene, const String &p_write_movie) {
 	VariantWriter::write_to_string(ED_GET_SHORTCUT("editor/stop_running_project"), shortcut);
 	OS::get_singleton()->set_environment("__GODOT_EDITOR_STOP_SHORTCUT__", shortcut);
 
-	printf("Running: %s", exec.utf8().get_data());
-	for (const String &E : args) {
-		printf(" %s", E.utf8().get_data());
-	};
-	printf("\n");
+	if (OS::get_singleton()->is_stdout_verbose()) {
+		print_line(vformat("Running: %s", exec));
+		for (const String &E : args) {
+			print_line(" %s", E);
+		}
+	}
 
 	int instances = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_instances", 1);
 	for (int i = 0; i < instances; i++) {

+ 1 - 1
modules/dds/texture_loader_dds.cpp

@@ -203,7 +203,7 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig
 	} else if (format_flags & DDPF_INDEXED && format_rgb_bits == 8) {
 		dds_format = DDS_BGR565;
 	} else {
-		printf("unrecognized fourcc %x format_flags: %x - rgbbits %i - red_mask %x green mask %x blue mask %x alpha mask %x\n", format_fourcc, format_flags, format_rgb_bits, format_red_mask, format_green_mask, format_blue_mask, format_alpha_mask);
+		//printf("unrecognized fourcc %x format_flags: %x - rgbbits %i - red_mask %x green mask %x blue mask %x alpha mask %x\n", format_fourcc, format_flags, format_rgb_bits, format_red_mask, format_green_mask, format_blue_mask, format_alpha_mask);
 		ERR_FAIL_V_MSG(Ref<Resource>(), "Unrecognized or unsupported color layout in DDS '" + p_path + "'.");
 	}
 

+ 0 - 9
platform/ios/godot_ios.mm

@@ -83,14 +83,9 @@ int ios_main(int argc, char **argv) {
 		char path[512];
 		memcpy(path, argv[0], len > sizeof(path) ? sizeof(path) : len);
 		path[len] = 0;
-		printf("Path: %s\n", path);
 		chdir(path);
 	}
 
-	printf("godot_ios %s\n", argv[0]);
-	char cwd[512];
-	getcwd(cwd, sizeof(cwd));
-	printf("cwd %s\n", cwd);
 	os = new OS_IOS();
 
 	// We must override main when testing is enabled
@@ -104,10 +99,7 @@ int ios_main(int argc, char **argv) {
 	argc = add_path(argc, fargv);
 	argc = add_cmdline(argc, fargv);
 
-	printf("os created\n");
-
 	Error err = Main::setup(fargv[0], argc - 1, &fargv[1], false);
-	printf("setup %i\n", err);
 
 	if (err == ERR_HELP) { // Returned by --help and --version, so success.
 		return 0;
@@ -121,7 +113,6 @@ int ios_main(int argc, char **argv) {
 }
 
 void ios_finish() {
-	printf("ios_finish\n");
 	Main::cleanup();
 	delete os;
 }

+ 3 - 3
platform/ios/godot_view.mm

@@ -173,7 +173,7 @@ static const float earth_gravity = 9.80665;
 
 	self.isActive = NO;
 
-	printf("******** stop animation!\n");
+	print_verbose("Stop animation!");
 
 	if (self.useCADisplayLink) {
 		[self.displayLink invalidate];
@@ -193,7 +193,7 @@ static const float earth_gravity = 9.80665;
 
 	self.isActive = YES;
 
-	printf("start animation!\n");
+	print_verbose("Start animation!");
 
 	if (self.useCADisplayLink) {
 		self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(drawView)];
@@ -213,7 +213,7 @@ static const float earth_gravity = 9.80665;
 
 - (void)drawView {
 	if (!self.isActive) {
-		printf("draw view not active!\n");
+		print_verbose("Draw view not active!");
 		return;
 	}
 

+ 1 - 1
platform/ios/ios.mm

@@ -173,7 +173,7 @@ String iOS::get_rate_url(int p_app_id) const {
 
 	String ret = app_url_path.replace("APP_ID", String::num(p_app_id));
 
-	printf("returning rate url %s\n", ret.utf8().get_data());
+	print_verbose(vformat("Returning rate url %s", ret));
 	return ret;
 }
 

+ 3 - 3
platform/ios/joypad_ios.mm

@@ -150,7 +150,7 @@ void JoypadIOS::start_processing() {
 	int joy_id = Input::get_singleton()->get_unused_joy_id();
 
 	if (joy_id == -1) {
-		printf("Couldn't retrieve new joy id\n");
+		print_verbose("Couldn't retrieve new joy ID.");
 		return;
 	}
 
@@ -174,12 +174,12 @@ void JoypadIOS::start_processing() {
 	GCController *controller = (GCController *)notification.object;
 
 	if (!controller) {
-		printf("Couldn't retrieve new controller\n");
+		print_verbose("Couldn't retrieve new controller.");
 		return;
 	}
 
 	if ([[self.connectedJoypads allKeysForObject:controller] count] > 0) {
-		printf("Controller is already registered\n");
+		print_verbose("Controller is already registered.");
 	} else if (!self.isProcessing) {
 		[self.joypadsQueue addObject:controller];
 	} else {

+ 0 - 3
platform/ios/main.m

@@ -42,15 +42,12 @@ int main(int argc, char *argv[]) {
 	setenv("MVK_CONFIG_FULL_IMAGE_VIEW_SWIZZLE", "1", 1);
 #endif
 
-	printf("*********** main.m\n");
 	gargc = argc;
 	gargv = argv;
 
-	printf("running app main\n");
 	@autoreleasepool {
 		NSString *className = NSStringFromClass([GodotApplicalitionDelegate class]);
 		UIApplicationMain(argc, argv, nil, className);
 	}
-	printf("main done\n");
 	return 0;
 }

+ 1 - 1
platform/ios/os_ios.mm

@@ -302,7 +302,7 @@ Error OS_IOS::shell_open(String p_uri) {
 		return ERR_CANT_OPEN;
 	}
 
-	printf("opening url %s\n", p_uri.utf8().get_data());
+	print_verbose(vformat("Opening URL %s", p_uri));
 
 	[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
 

+ 3 - 3
platform/ios/view_controller.mm

@@ -150,7 +150,7 @@
 
 - (void)didReceiveMemoryWarning {
 	[super didReceiveMemoryWarning];
-	printf("*********** did receive memory warning!\n");
+	print_verbose("Did receive memory warning!");
 }
 
 - (void)viewDidLoad {
@@ -165,11 +165,11 @@
 }
 
 - (void)observeKeyboard {
-	printf("******** setting up keyboard input view\n");
+	print_verbose("Setting up keyboard input view.");
 	self.keyboardView = [GodotKeyboardInputView new];
 	[self.view addSubview:self.keyboardView];
 
-	printf("******** adding observer for keyboard show/hide\n");
+	print_verbose("Adding observer for keyboard show/hide.");
 	[[NSNotificationCenter defaultCenter]
 			addObserver:self
 			   selector:@selector(keyboardOnScreen:)

+ 3 - 3
platform/linuxbsd/x11/display_server_x11.cpp

@@ -605,7 +605,7 @@ String DisplayServerX11::_clipboard_get_impl(Atom p_source, Window x11_window, A
 							success = true;
 						}
 					} else {
-						printf("Failed to get selection data chunk.\n");
+						print_verbose("Failed to get selection data chunk.");
 						done = true;
 					}
 
@@ -632,7 +632,7 @@ String DisplayServerX11::_clipboard_get_impl(Atom p_source, Window x11_window, A
 			if (result == Success) {
 				ret.parse_utf8((const char *)data);
 			} else {
-				printf("Failed to get selection data.\n");
+				print_verbose("Failed to get selection data.");
 			}
 
 			if (data) {
@@ -3343,7 +3343,7 @@ Atom DisplayServerX11::_process_selection_request_target(Atom p_target, Window p
 		return p_property;
 	} else {
 		char *target_name = XGetAtomName(x11_display, p_target);
-		printf("Target '%s' not supported.\n", target_name);
+		print_verbose(vformat("Target '%s' not supported.", target_name));
 		if (target_name) {
 			XFree(target_name);
 		}

+ 1 - 1
scene/resources/polygon_path_finder.cpp

@@ -303,7 +303,7 @@ Vector<Vector2> PolygonPathFinder::find_path(const Vector2 &p_from, const Vector
 
 	while (true) {
 		if (open_list.size() == 0) {
-			printf("open list empty\n");
+			print_verbose("Open list empty.");
 			break;
 		}
 		//check open list