Merge pull request #74931 from bruvzg/no_print

Remove (or make verbose only) various debug prints.
This commit is contained in:
Yuri Sizov 2023-03-20 15:12:02 +01:00 committed by GitHub
commit f08de75236
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 22 additions and 38 deletions

View file

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

View file

@ -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)) { 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."); ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as depth-stencil attachment.");
} }

View file

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

View file

@ -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) { } else if (format_flags & DDPF_INDEXED && format_rgb_bits == 8) {
dds_format = DDS_BGR565; dds_format = DDS_BGR565;
} else { } 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 + "'."); ERR_FAIL_V_MSG(Ref<Resource>(), "Unrecognized or unsupported color layout in DDS '" + p_path + "'.");
} }

View file

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

View file

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

View file

@ -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)); 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; return ret;
} }

View file

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

View file

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

View file

@ -302,7 +302,7 @@ Error OS_IOS::shell_open(String p_uri) {
return ERR_CANT_OPEN; 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]; [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];

View file

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

View file

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

View file

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