Added a new logging option, -L, to nccopy.
@@ -1767,6 +1767,7 @@ usage(void)
[-e n] set number of elements that chunk_cache can hold\n\
[-r] read whole input file into diskless file on open (classic or 64-bit offset or cdf5 formats only)\n\
[-F filterspec] specify the compression algorithm to apply to an output variable.\n\
+ [-Ln] set log level to n (>= 0); ignored if logging isn't enabled.\n\
infile name of netCDF input file\n\
outfile name for netCDF output file\n"
@@ -1840,7 +1841,7 @@ main(int argc, char**argv)
usage();
}
- while ((c = getopt(argc, argv, "k:3467d:sum:c:h:e:rwxg:G:v:V:F:")) != -1) {
+ while ((c = getopt(argc, argv, "k:3467d:sum:c:h:e:rwxg:G:v:V:F:L:")) != -1) {
switch(c) {
case 'k': /* for specifying variant of netCDF format to be generated
Format names:
@@ -1955,6 +1956,15 @@ main(int argc, char**argv)
make_lvars (optarg, &option_nlvars, &option_lvars);
option_varstruct = false;
break;
+ case 'L': /* Set logging, if logging support was compiled in. */
+#ifdef LOGGING
+ {
+ int level = atoi(optarg);
+ if(level >= 0)
+ nc_set_log_level(level);
+ }
+#endif
+ break;
case 'F': /* optional filter spec for a specified variable */
#ifdef USE_NETCDF4
if(!parsefilterspec(optarg,&filterspec)) usage();
