Page MenuHomePhabricator

mediawiki_api Ruby gem outputs a lot of information to terminal
Closed, ResolvedPublic

Description

mediawiki_api Ruby gem[1] outputs a lot of information to terminal during normal usage. By default, it should not output anything. Current output is appropriate when debugging, it too verbose for normal usage.

1: https://rubygems.org/gems/mediawiki_api

For example, this is output when running tests:

$ rspec
I, [2014-04-07T13:49:28.477723 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.477808 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.479501 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.479533 #4333] DEBUG -- response:
.I, [2014-04-07T13:49:28.481032 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.481072 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.486290 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.486330 #4333] DEBUG -- response: set-cookie: "prefixSession=789; path=/; domain=localhost; HttpOnly"
I, [2014-04-07T13:49:28.486556 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.486598 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.487556 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.487584 #4333] DEBUG -- response:
.I, [2014-04-07T13:49:28.488282 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.488315 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.489691 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.489723 #4333] DEBUG -- response: set-cookie: "prefixSession=789; path=/; domain=localhost; HttpOnly"
I, [2014-04-07T13:49:28.489863 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.489902 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.490762 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.490788 #4333] DEBUG -- response:
.I, [2014-04-07T13:49:28.492586 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.492636 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.493536 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.493564 #4333] DEBUG -- response:
.I, [2014-04-07T13:49:28.494100 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.494134 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.495106 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.495138 #4333] DEBUG -- response:
.I, [2014-04-07T13:49:28.495890 #4333] INFO -- : get http://localhost/api.php?action=tokens&format=json&type=edit
D, [2014-04-07T13:49:28.495923 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
I, [2014-04-07T13:49:28.498195 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.498222 #4333] DEBUG -- response:
I, [2014-04-07T13:49:28.498369 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.498400 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.499316 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.499343 #4333] DEBUG -- response:
.*I, [2014-04-07T13:49:28.500330 #4333] INFO -- : get http://localhost/api.php?action=tokens&format=json&type=delete
D, [2014-04-07T13:49:28.500366 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
I, [2014-04-07T13:49:28.502782 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.502812 #4333] DEBUG -- response:
I, [2014-04-07T13:49:28.502969 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.503001 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.504005 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.504033 #4333] DEBUG -- response:
.I, [2014-04-07T13:49:28.504866 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.504902 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.505835 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.505863 #4333] DEBUG -- response:
.I, [2014-04-07T13:49:28.506544 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.506579 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.507961 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.508003 #4333] DEBUG -- response: set-cookie: "prefixSession=789; path=/; domain=localhost; HttpOnly"
I, [2014-04-07T13:49:28.508177 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.508207 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.509064 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.509116 #4333] DEBUG -- response:
.I, [2014-04-07T13:49:28.509760 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.509795 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.511144 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.511176 #4333] DEBUG -- response: set-cookie: "prefixSession=789; path=/; domain=localhost; HttpOnly"
I, [2014-04-07T13:49:28.511332 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.511367 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.512227 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.512260 #4333] DEBUG -- response:
.I, [2014-04-07T13:49:28.513269 #4333] INFO -- : post http://localhost/api.php
D, [2014-04-07T13:49:28.513304 #4333] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "application/x-www-form-urlencoded"
I, [2014-04-07T13:49:28.514313 #4333] INFO -- Status: 200
D, [2014-04-07T13:49:28.514340 #4333] DEBUG -- response:
.

Pending:

MediawikiApi::Client#create_page when API returns Success returns a MediawikiApi::Page
  # Not yet implemented
  # ./spec/client_spec.rb:83

Finished in 0.05047 seconds
12 examples, 0 failures, 1 pending


Version: wmf-deployment
Severity: normal

Details

Reference
bz63609

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:19 AM
bzimport set Reference to bz63609.
bzimport added a subscriber: Unknown Object (MLST).

Resolved in https://gerrit.wikimedia.org/r/#/c/124384/

$ rspec
......*......

Pending:

MediawikiApi::Client#create_page when API returns Success returns a MediawikiApi::Page
  # Not yet implemented
  # ./spec/client_spec.rb:83

Finished in 0.08044 seconds
13 examples, 0 failures, 1 pending