github: Remove old logging
authorAlexandre Terrasa <alexandre@moz-code.org>
Thu, 11 Jul 2019 02:35:40 +0000 (22:35 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Fri, 12 Jul 2019 00:41:41 +0000 (20:41 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/github/api.nit
lib/github/cache.nit

index ee62031..bd01519 100644 (file)
@@ -91,12 +91,6 @@ class GithubAPI
        # Default is `https://api.github.com` and should not be changed.
        var api_url = "https://api.github.com"
 
-       # Verbosity level.
-       #
-       # * `0`: only errors (default)
-       # * `1`: verbose
-       var verbose_lvl = 0 is public writable
-
        # Send a HTTPRequest to the Github API
        fun send(method, path: String, headers: nullable HeaderMap, body: nullable String): nullable String do
                last_error = null
@@ -143,11 +137,6 @@ class GithubAPI
                return res
        end
 
-       # Display a message depending on `verbose_lvl`.
-       fun message(lvl: Int, message: String) do
-               if lvl <= verbose_lvl then print message
-       end
-
        # Escape `uri` in an acceptable format for Github.
        private fun sanitize_uri(uri: String): String do
                # TODO better URI escape.
index a34bb4e..dbb4ad0 100644 (file)
@@ -58,7 +58,7 @@ redef class GithubAPI
        redef fun get(key, headers, data) do
                if not enable_cache then return super
                if store.has_key(key) then
-                       message(1, "Get {key} (cache)")
+                       # print "Get {key} (cache)" # debug
                        was_error = false
                        return deserialize(store.load_object(key).to_json)
                end
@@ -71,7 +71,7 @@ redef class GithubAPI
 
        # Save `json` data in cache under `key`.
        private fun cache(key: String, obj: Serializable) do
-               message(2, "Cache key {key}")
+               # print "Cache key {key}" # debug
                store.store_object(key, obj.to_json.parse_json.as(JsonObject))
        end