commit 212d135

default  ·  2023-05-04 09:53:17 +0000 UTC
parent ec6f94e
Fixed mastoapi debug levels.
1 files changed,  +8, -8
+8, -8
 1@@ -213,13 +213,13 @@ int oauth_get_handler(const xs_dict *req, const char *q_path,
 2                 *ctype = "text/html";
 3                 status = 200;
 4 
 5-                srv_debug(0, xs_fmt("oauth authorize: generating login page"));
 6+                srv_debug(1, xs_fmt("oauth authorize: generating login page"));
 7             }
 8             else
 9-                srv_debug(0, xs_fmt("oauth authorize: bad client_id %s", cid));
10+                srv_debug(1, xs_fmt("oauth authorize: bad client_id %s", cid));
11         }
12         else
13-            srv_debug(0, xs_fmt("oauth authorize: invalid or unset arguments"));
14+            srv_debug(1, xs_fmt("oauth authorize: invalid or unset arguments"));
15     }
16     else
17     if (strcmp(cmd, "/x-snac-get-token") == 0) {
18@@ -389,7 +389,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
19 
20                 const char *uid = xs_dict_get(app, "uid");
21 
22-                srv_debug(0, xs_fmt("oauth token: "
23+                srv_debug(1, xs_fmt("oauth token: "
24                                 "successful login for %s, new token %s", uid, tokid));
25 
26                 xs *token = xs_dict_new();
27@@ -403,7 +403,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
28             }
29         }
30         else {
31-            srv_debug(0, xs_fmt("oauth token: invalid or unset arguments"));
32+            srv_debug(1, xs_fmt("oauth token: invalid or unset arguments"));
33             status = 400;
34         }
35     }
36@@ -425,7 +425,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
37             }
38             else {
39                 token_del(tokid);
40-                srv_debug(0, xs_fmt("oauth revoke: revoked token %s", tokid));
41+                srv_debug(1, xs_fmt("oauth revoke: revoked token %s", tokid));
42                 status = 200;
43 
44                 /* also delete the app, as it serves no purpose from now on */
45@@ -433,7 +433,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
46             }
47         }
48         else {
49-            srv_debug(0, xs_fmt("oauth revoke: invalid or unset arguments"));
50+            srv_debug(1, xs_fmt("oauth revoke: invalid or unset arguments"));
51             status = 403;
52         }
53     }
54@@ -1611,7 +1611,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
55 
56             app_add(cid, app);
57 
58-            srv_debug(0, xs_fmt("mastoapi apps: new app %s", cid));
59+            srv_debug(1, xs_fmt("mastoapi apps: new app %s", cid));
60         }
61     }
62     else