aboutsummaryrefslogtreecommitdiff
path: root/src/apps/cs2cs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/apps/cs2cs.cpp')
-rw-r--r--src/apps/cs2cs.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/apps/cs2cs.cpp b/src/apps/cs2cs.cpp
index 1a33d444..12e045bb 100644
--- a/src/apps/cs2cs.cpp
+++ b/src/apps/cs2cs.cpp
@@ -468,10 +468,23 @@ int main(int argc, char **argv) {
reverseout = 1;
continue;
case 'D': /* set debug level */
+ {
if (--argc <= 0)
goto noargument;
- pj_ctx_set_debug(pj_get_default_ctx(), atoi(*++argv));
+ int log_level = atoi(*++argv);
+ if (log_level <= 0) {
+ proj_log_level(pj_get_default_ctx(), PJ_LOG_NONE);
+ } else if (log_level == 1) {
+ proj_log_level(pj_get_default_ctx(), PJ_LOG_ERROR);
+ } else if (log_level == 2) {
+ proj_log_level(pj_get_default_ctx(), PJ_LOG_DEBUG);
+ } else if (log_level == 3) {
+ proj_log_level(pj_get_default_ctx(), PJ_LOG_TRACE);
+ } else {
+ proj_log_level(pj_get_default_ctx(), PJ_LOG_TELL);
+ }
continue;
+ }
case 'd':
if (--argc <= 0)
goto noargument;
@@ -611,7 +624,7 @@ int main(int argc, char **argv) {
if (!transformation) {
emess(3, "cannot initialize transformation\ncause: %s",
- pj_strerrno(pj_errno));
+ proj_errno_string(proj_context_errno(nullptr)));
}
if (use_env_locale) {