GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73685
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
debug.c File Reference

GIS Library - Debug functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for debug.c:

Go to the source code of this file.

Functions

void G_init_debug (void)
 Initiate debugging. More...
 
int G_debug (int level, const char *msg,...)
 Print debugging message. More...
 

Detailed Description

GIS Library - Debug functions.

(C) 2001-2012 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
GRASS GIS Development Team

Definition in file debug.c.

Function Documentation

int G_debug ( int  level,
const char *  msg,
  ... 
)

Print debugging message.

Print debugging message if environment variable GRASS_DEBUG_LEVEL is set to level equal or greater

Levels: (recommended levels)

  • 1 - message is printed once or twice per module
  • 2 - less interesting once-per-module messages,
  • 2 - library functions likely to be used once in a module
  • 3 - library functions likely to be called a few times in a module (<=10),
  • 3 - database opening and closing logistics
  • 4 - each row (raster) or line (vector) or database/column (DB),
  • 4 - each column/cat (DB)
  • 5 - each cell (raster) or point (vector) or cat/attribute (DB)
Parameters
[in]levellevel
[in]msgmessage
Returns
0 on error
1 on success

Definition at line 65 of file debug.c.

References _, fclose(), fd, G_init_debug(), G_warning(), getenv(), and NULL.

Referenced by add_coor(), add_ipoint(), alloc_statistics(), AS_eqdrt(), c_thresh(), Cairo_begin_raster(), Cairo_Bitmap(), Cairo_Box(), Cairo_Color(), Cairo_end_raster(), Cairo_Erase(), Cairo_Graph_close(), Cairo_Graph_set(), Cairo_Line_width(), Cairo_raster(), cairo_read_image(), Cairo_Set_window(), cairo_write_image(), close_band_files(), D_open_driver(), D_plot_icon(), db__driver_begin_transaction(), db__driver_commit_transaction(), db_CatValArray_get_value_double(), db_close_database_shutdown_driver(), db_d_init_error(), db_delete_table(), db_driver(), db_get_column(), db_get_login_dump(), db_read_dbmscap(), db_select_CatValArray(), db_select_int(), db_set_default_connection(), db_start_driver(), db_start_driver_open_database(), db_table_exists(), db_table_to_sql(), dig__read_head(), dig__write_head(), dig_add_area(), dig_add_isle(), dig_add_node(), dig_alloc_isles(), dig_angle_next_line(), dig_area_add_isle(), dig_area_alloc_isle(), dig_area_del_isle(), dig_build_area_with_line(), dig_cidx_add_cat(), dig_cidx_add_cat_sorted(), dig_cidx_del_cat(), dig_cidx_free(), dig_cidx_init(), dig_cidx_sort(), dig_del_area(), dig_del_isle(), dig_del_line(), dig_file_load(), dig_find_area_box(), dig_find_isle_box(), dig_find_line_box(), dig_find_node(), dig_free_plus(), dig_free_plus_areas(), dig_free_plus_isles(), dig_free_plus_lines(), dig_free_plus_nodes(), dig_init_plus(), dig_isle_alloc_line(), dig_line_add_updated(), dig_line_degenerate(), dig_line_get_area(), dig_load_plus(), dig_node_add_line(), dig_node_add_updated(), dig_node_alloc_line(), dig_node_angle_check(), dig_node_line_angle(), dig_Rd_P_area(), dig_Rd_P_isle(), dig_Rd_P_line(), dig_Rd_P_node(), dig_Rd_Plus_head(), dig_Rd_spidx(), dig_Rd_spidx_head(), dig_read_cidx(), dig_read_cidx_head(), dig_read_frmt_ascii(), dig_select_areas(), dig_select_isles(), dig_select_lines(), dig_select_nodes(), dig_spidx_add_area(), dig_spidx_add_isle(), dig_spidx_add_line(), dig_spidx_add_node(), dig_spidx_del_area(), dig_spidx_del_isle(), dig_spidx_del_line(), dig_spidx_del_node(), dig_spidx_init(), dig_Wr_P_line(), dig_Wr_P_node(), dig_Wr_Plus_head(), dig_Wr_spidx(), dig_Wr_spidx_head(), dig_write_cidx_head(), dig_write_frmt_ascii(), find_all_intersections(), free_data_buffs(), free_perimeters(), G__read_Cell_head(), G__read_Cell_head_array(), G__temp_element(), G_compare_projections(), G_find_raster(), G_find_raster2(), G_find_vector(), G_find_vector2(), G_fopen_append(), G_fopen_modify(), G_fopen_new(), G_fopen_old(), G_get_available_mapsets(), G_get_projepsg(), G_has_vector_timestamp(), G_math_add_spvector(), G_math_alloc_spmatrix(), G_math_alloc_spvector(), G_math_cholesky_sband_decomposition(), G_option_to_separator(), G_read_vector_timestamp(), G_set_program_name(), G_str_to_color(), G_tempfile_pid(), G_write_vector_timestamp(), get_key_data(), GK_add_key(), gk_follow_frames(), GP_delete_site(), gp_delete_site(), GP_draw_site(), gp_free_site(), gp_get_last_site(), gp_get_new_site(), gp_get_prev_site(), gp_get_site(), GP_get_sitename(), GP_get_style(), GP_get_trans(), GP_get_zmode(), gp_init_site(), GP_load_site(), Gp_load_sites(), GP_new_site(), gp_num_sites(), GP_select_surf(), gp_set_defaults(), GP_set_style(), GP_set_style_thematic(), GP_set_trans(), GP_set_zmode(), GP_site_exists(), GP_surf_is_selected(), GP_unselect_surf(), GP_unset_style_thematic(), GPJ__get_datum_params(), GPJ_grass_to_osr(), GPJ_osr_to_grass(), Gs_build_256lookup(), gs_calc_normals(), GS_clear(), GS_default_draw_color(), gs_delete_surf(), GS_delete_surface(), GS_done_draw(), GS_draw_flowline_at_xy(), GS_draw_fringe(), GS_draw_surf(), GS_draw_wire(), gs_free_surf(), gs_free_unshared_buffs(), GS_get_aspect(), gs_get_att_src(), gs_get_att_typbuff(), gs_get_att_type(), GS_get_distance_alongsurf(), GS_get_drawres(), GS_get_exag_guess(), GS_get_focus(), GS_get_from(), gs_get_last_surface(), GS_get_longdim(), GS_get_modelposition1(), gs_get_new_surface(), GS_get_nozero(), gs_get_prev_surface(), GS_get_selected_point_on_surface(), gs_get_surf(), GS_get_to(), GS_get_trans(), GS_get_zextents(), GS_get_zrange(), GS_get_zrange_nz(), gs_getall_surfaces(), GS_global_exag(), gs_init_surf(), GS_init_view(), GS_libinit(), GS_load_att_map(), Gs_loadmap_as_bitmap(), Gs_loadmap_as_char(), Gs_loadmap_as_float(), Gs_loadmap_as_int(), Gs_loadmap_as_short(), gs_los_intersect(), gs_los_intersect1(), gs_malloc_att_buff(), gs_malloc_lookup(), GS_moveto(), GS_new_surface(), gs_num_datah_reused(), gs_num_surfaces(), Gs_numtype(), GS_ready_draw(), gs_set_att_const(), GS_set_att_defaults(), gs_set_att_src(), gs_set_att_type(), gs_set_defaults(), GS_set_drawmode(), GS_set_drawres(), GS_set_exag(), GS_set_focus(), GS_set_focus_center_map(), GS_set_global_exag(), GS_set_infocus(), GS_set_nofocus(), GS_set_nozero(), GS_set_trans(), GS_set_viewport(), GS_set_wire_color(), GS_surf_exists(), Gs_update_attrange(), gs_update_curmask(), gsd_3darrow(), gsd_arrow_onsurf(), gsd_norm_arrows(), gsd_ortho_wall(), gsd_surf(), gsd_surf_const(), gsd_surf_map_old(), gsd_wire_arrows(), gsd_wire_surf(), gsd_wire_surf_const(), gsd_wire_surf_map(), gsds_alloc_typbuff(), gsds_free_datah(), gv_decimate_lines(), gv_delete_vect(), GV_delete_vector(), gv_free_vect(), gv_get_last_vect(), gv_get_new_vect(), gv_get_prev_vect(), gv_get_vect(), gv_init_vect(), Gv_load_vect(), GV_new_vector(), gv_num_vects(), gv_set_defaults(), GV_set_trans(), GV_unset_style_thematic(), GV_vect_exists(), gvd_vect(), gvl_align_data(), GVL_delete_vol(), gvl_delete_vol(), GVL_draw_wire(), gvl_file_free_datah(), gvl_free_vol(), GVL_get_dims(), gvl_get_last_vol(), gvl_get_new_vol(), gvl_get_prev_vol(), gvl_get_vol(), gvl_getall_vols(), gvl_init_vol(), GVL_isosurf_add(), GVL_isosurf_del(), gvl_isosurf_freemem(), GVL_isosurf_get_att(), gvl_isosurf_get_att_src(), GVL_isosurf_get_drawres(), GVL_isosurf_get_flags(), gvl_isosurf_get_isosurf(), gvl_isosurf_init(), GVL_isosurf_move_down(), GVL_isosurf_move_up(), GVL_isosurf_num_isosurfs(), gvl_isosurf_set_att_changed(), gvl_isosurf_set_att_const(), GVL_isosurf_set_att_const(), gvl_isosurf_set_att_map(), GVL_isosurf_set_att_map(), gvl_isosurf_set_att_src(), GVL_isosurf_set_drawmode(), GVL_isosurf_set_drawres(), GVL_isosurf_set_flags(), GVL_isosurf_set_maskmode(), GVL_isosurf_unset_att(), GVL_load_vol(), GVL_new_vol(), gvl_num_vols(), GVL_set_draw_wire(), GVL_set_focus_center_map(), GVL_set_trans(), GVL_slice_add(), GVL_slice_del(), gvl_slice_freemem(), GVL_slice_get_drawres(), GVL_slice_get_transp(), gvl_slice_init(), GVL_slice_move_down(), GVL_slice_move_up(), GVL_slice_num_slices(), GVL_slice_set_drawmode(), GVL_slice_set_drawres(), GVL_slice_set_transp(), gvl_slices_calc(), GVL_vol_exists(), gvl_write_char(), gvld_isosurf(), gvld_slices(), gvld_vol(), gvld_wind3_box(), gvld_wire_slices(), gvld_wire_vol(), I_cluster_assign(), I_cluster_exec_allocate(), I_cluster_means(), I_cluster_sum2(), I_compute_scatts(), I_find_signature_file(), I_find_subgroup(), I_find_subgroup2(), I_find_subgroup_file(), I_find_subgroup_file2(), I_iclass_add_signature(), I_iclass_analysis(), I_iclass_free_statistics(), I_iclass_init_group(), I_iclass_init_signatures(), I_iclass_init_statistics(), I_iclass_write_signatures(), IL_check_at_points_2d(), IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), IL_matrix_create_alloc(), IL_vector_input_data_2d(), kdtree_optimize(), kdtree_traverse(), M_do_copy(), make_all_statistics(), make_perimeter(), make_statistics(), N_alloc_array_2d(), N_alloc_array_3d(), N_alloc_gradient_field_2d(), N_alloc_gradient_field_3d(), N_alloc_les_param(), N_assemble_les_2d_param(), N_assemble_les_3d_param(), N_calc_array_2d_stats(), N_calc_array_3d_stats(), N_calc_gradient_field_2d_stats(), N_calc_gradient_field_3d_stats(), N_calc_solute_transport_disptensor_2d(), N_calc_solute_transport_disptensor_3d(), N_calc_solute_transport_transmission_2d(), N_callback_gwflow_2d(), N_callback_gwflow_3d(), N_callback_solute_transport_2d(), N_callback_solute_transport_3d(), N_callback_template_3d(), N_compute_gradient_field_2d(), N_compute_gradient_field_3d(), N_convert_array_2d_null_to_zero(), N_convert_array_3d_null_to_zero(), N_copy_array_2d(), N_copy_array_3d(), N_copy_gradient_2d(), N_copy_gradient_3d(), N_copy_gradient_field_2d(), N_copy_gradient_field_3d(), N_copy_gradient_neighbours_2d(), N_copy_gradient_neighbours_3d(), N_copy_gradient_neighbours_x(), N_copy_gradient_neighbours_y(), N_copy_gradient_neighbours_z(), N_create_27star(), N_create_5star(), N_create_7star(), N_create_9star(), N_create_gradient_2d(), N_create_gradient_3d(), N_create_gradient_neighbours_2d(), N_create_gradient_neighbours_3d(), N_create_gradient_neighbours_x(), N_create_gradient_neighbours_y(), N_create_gradient_neighbours_z(), N_free_array_2d(), N_free_array_3d(), N_free_les(), N_get_geom_data_area_of_cell(), N_get_gradient_2d(), N_get_gradient_3d(), N_get_gradient_neighbours_2d(), N_init_geom_data_2d(), N_init_geom_data_3d(), N_is_array_2d_value_null(), N_is_array_3d_value_null(), N_les_integrate_dirichlet_2d(), N_les_integrate_dirichlet_3d(), N_math_array_2d(), N_math_array_3d(), N_norm_array_2d(), N_norm_array_3d(), N_put_array_2d_value(), N_put_array_2d_value_null(), N_put_array_3d_value(), N_put_array_3d_value_null(), Nviz_change_exag(), Nviz_get_exag(), Nviz_get_exag_height(), Nviz_get_viewpoint_height(), Nviz_get_viewpoint_position(), Nviz_init_light(), Nviz_look_here(), Nviz_resize_window(), Nviz_set_light_ambient(), Nviz_set_light_bright(), Nviz_set_light_color(), Nviz_set_light_position(), Nviz_set_rotation(), Nviz_set_viewpoint_height(), Nviz_set_viewpoint_persp(), Nviz_set_viewpoint_position(), Nviz_set_viewpoint_twist(), open_band_files(), order_intersects(), P_Create_Aux2_Table(), P_Create_Aux4_Table(), perimeter_add_point(), pg_addedge(), pg_create(), PNG_Graph_set(), print_vol_fields(), Rast3d_compute_optimal_tile_dimension(), Rast3d_coord2location(), Rast3d_location2coord_double(), Rast3d_open_new_opt_tile_size(), Rast__create_window_mapping(), Rast_align_window(), Rast_get_cat(), Rast_get_next_marked_d_cat(), Rast_read_color_rule(), Rast_read_fp_range(), Rast_read_rstats(), Rast_sort_cats(), Rast_unset_window(), rbtree_remove(), rbtree_traverse(), rbtree_traverse_backwd(), read_band_row(), read_coor(), recreate_command(), S_read(), S_stroke(), seg_pagein(), seg_setup(), segment_intersection_2d(), segment_intersection_2d_tol(), sort_intersection_list(), stroke_chain(), sub_Vectmem(), V1_close_nat(), V1_close_ogr(), V1_close_pg(), V1_delete_line_nat(), V1_delete_line_ogr(), V1_delete_line_pg(), V1_open_new_nat(), V1_open_new_ogr(), V1_open_new_pg(), V1_open_old_nat(), V1_open_old_ogr(), V1_open_old_pg(), V1_read_line_ogr(), V1_read_line_pg(), V1_read_next_line_nat(), V1_read_next_line_pg(), V1_restore_line_nat(), V1_rewind_ogr(), V1_rewind_pg(), V1_rewrite_line_nat(), V1_rewrite_line_ogr(), V1_rewrite_line_pg(), V2__add_line_to_topo_nat(), V2__delete_line_from_topo_nat(), V2_close_ogr(), V2_close_pg(), V2_delete_line_nat(), V2_delete_line_sfa(), V2_open_old_ogr(), V2_open_old_pg(), V2_read_line_nat(), V2_read_line_pg(), V2_read_line_sfa(), V2_read_next_line_nat(), V2_read_next_line_ogr(), V2_read_next_line_pg(), V2_restore_line_nat(), V2_rewind_ogr(), V2_rewind_pg(), V2_rewrite_line_pg(), V2_rewrite_line_sfa(), V2_write_line_nat(), V2_write_line_sfa(), Vect__copy_areas(), Vect__delete(), Vect__get_area_points_nat(), Vect__open_old(), Vect__read_head(), Vect_add_dblink(), Vect_area_buffer2(), Vect_array_to_cat_list(), Vect_attach_centroids(), Vect_attach_isle(), Vect_attach_isles(), Vect_break_polygons_file(), Vect_break_polygons_mem(), Vect_build_line_area(), Vect_build_nat(), Vect_build_ogr(), Vect_build_partial(), Vect_build_pg(), Vect_build_sidx_from_topo(), Vect_cat_list_to_array(), Vect_check_dblink(), Vect_cidx_dump(), Vect_cidx_find_next(), Vect_cidx_get_field_index(), Vect_cidx_get_type_count(), Vect_cidx_open(), Vect_cidx_save(), Vect_clean_small_angles_at_nodes(), Vect_close(), Vect_coor_info(), Vect_copy(), Vect_copy_table_by_cats(), Vect_copy_tables(), Vect_default_field_info(), Vect_delete_line(), Vect_find_area(), Vect_find_island(), Vect_find_line_list(), Vect_find_node(), Vect_get_area_area(), Vect_get_area_boundaries(), Vect_get_area_centroid(), Vect_get_area_isle(), Vect_get_area_num_isles(), Vect_get_area_perimeter(), Vect_get_area_points(), Vect_get_area_points_geos(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), Vect_get_dblink(), Vect_get_field(), Vect_get_field2(), Vect_get_field_by_name(), Vect_get_field_number(), Vect_get_finfo_dsn_name(), Vect_get_finfo_geometry_type(), Vect_get_finfo_layer_name(), Vect_get_isle_area(), Vect_get_isle_boundaries(), Vect_get_isle_points(), Vect_get_isle_points_geos(), Vect_get_line_cat(), Vect_get_next_line_id(), Vect_get_point_in_area(), Vect_get_point_in_poly(), Vect_get_point_in_poly_isl(), Vect_get_proj_name(), Vect_graph_add_edge(), Vect_graph_build(), Vect_graph_init(), Vect_graph_set_node_costs(), Vect_graph_shortest_path(), Vect_hist_command(), Vect_hist_copy(), Vect_hist_read(), Vect_hist_rewind(), Vect_hist_write(), Vect_isle_find_area(), Vect_line_buffer2(), Vect_line_intersection(), Vect_line_intersection2(), Vect_line_parallel(), Vect_line_parallel2(), Vect_line_segment(), Vect_line_to_geos(), Vect_map_del_dblink(), Vect_merge_lines(), Vect_net_build_graph(), Vect_net_get_line_cost(), Vect_net_get_node_cost(), Vect_net_nearest_nodes(), Vect_net_ttb_build_graph(), Vect_net_ttb_shortest_path(), Vect_open_fidx(), Vect_open_new(), Vect_open_sidx(), Vect_open_tmp_new(), Vect_open_topo(), Vect_overlay_and(), Vect_point_buffer2(), Vect_point_in_area_outer_ring(), Vect_point_in_island(), Vect_point_in_poly(), Vect_point_on_line(), Vect_read_area_geos(), Vect_read_ascii(), Vect_read_dblinks(), Vect_read_line(), Vect_read_line_geos(), Vect_read_next_line(), Vect_remove_duplicates(), Vect_remove_small_areas_ext(), Vect_remove_small_areas_nat(), Vect_rename(), Vect_restore_line(), Vect_rewind(), Vect_rewrite_line(), Vect_save_fidx(), Vect_save_sidx(), Vect_save_topo(), Vect_segment_intersection(), Vect_select_areas_by_box(), Vect_select_areas_by_polygon(), Vect_select_isles_by_box(), Vect_select_lines_by_box(), Vect_select_lines_by_polygon(), Vect_select_nodes_by_box(), Vect_set_thresh(), Vect_set_updated(), Vect_set_varray_from_cat_list(), Vect_set_varray_from_cat_string(), Vect_set_varray_from_db(), Vect_snap_line(), Vect_snap_lines(), Vect_spatial_index_add_item(), Vect_spatial_index_del_item(), Vect_spatial_index_destroy(), Vect_spatial_index_init(), Vect_spatial_index_select(), Vect_str_to_cat_list(), Vect_subst_var(), Vect_tin_get_z(), Vect_topo_check(), Vect_write_ascii(), Vect_write_dblinks(), Vect_write_line(), vector2perimeters(), Vedit_add_vertex(), Vedit_chtype_lines(), Vedit_connect_lines(), Vedit_copy_lines(), Vedit_delete_area(), Vedit_delete_area_centroid(), Vedit_delete_areas_cat(), Vedit_delete_lines(), Vedit_extend_lines(), Vedit_flip_lines(), Vedit_get_min_distance(), Vedit_merge_lines(), Vedit_move_lines(), Vedit_move_vertex(), Vedit_remove_vertex(), Vedit_render_map(), Vedit_select_by_query(), Vedit_snap_line(), Vedit_snap_point(), and Vedit_split_lines().

void G_init_debug ( void  )

Initiate debugging.

Definition at line 27 of file debug.c.

References G_getenv_nofatal(), G_initialize_done(), G_is_initialized(), and NULL.

Referenced by G_debug(), and G_init_all().