8000 feat: mute many log.info and log.success by hanxiao · Pull Request #2771 · jina-ai/serve · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: mute many log.info and log.success #2771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2021
Merged

Conversation

hanxiao
Copy link
Member
@hanxiao hanxiao commented Jun 25, 2021

https://jinaai.slack.com/archives/C018F60RBL5/p1624635344068600

There are too many information on the screen as Jina running, it creates the following problems:
Very scary to new users.
Feel heavy. To be honest, every program (even assembly) feel super heavy if you print every line on the screen.
Too loud, belittle user. As a framework, loud log outputs gives user a impression that, "what you are building & output is insignificant, because I'm emitting a looot and they are more important! So please read my output and good luck of finding your output."

In the screenshot below (readme code snippet), the user own log output is in the redbox, take a look at the ratio there. All the other lines in the screenshot are emitted from Jina. Don't you think it is completely overwhelming?

Another argument, when we write
with open('a.txt') as fp:
fp.write()
do we see the console logs like the following?
fp is opened successfully!
fp is written with some blah
fp is now closed
No. Then why would Jina do that?

I think 2.0 is the right time to make some INFO level log to DEBUG and only emit when necessary. This does not only give user a cleaner console, but also
❤️ really put user's code/logic as the first priority
🧊 makes our framework as transparent as Python
:unicorn_face: shows the confidence of ourself -> we are shipping robust code, we know the framework behavior without printing every line on the screen.

One may argue that, "oh, then it may slow down our own development." It won't, you just add export JINA_LOG_LEVEL=DEBUG to bashrc.

┆Issue is synchronized with this Asana task by Unito

@hanxiao hanxiao requested a review from a team as a code owner June 25, 2021 16:41
@hanxiao hanxiao requested review from mapleeit and numb3r3 June 25, 2021 16:41
@jina-bot jina-bot added size/S area/core This issue/PR affects the core codebase area/network This issue/PR affects network functionality component/client component/flow component/logging component/peapod labels Jun 25, 2021
@codecov
Copy link
codecov bot commented Jun 25, 2021

Codecov Report

Merging #2771 (c9c7c09) into master (c613fa7) will decrease coverage by 2.20%.
The diff coverage is 76.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2771      +/-   ##
==========================================
- Coverage   88.97%   86.77%   -2.21%     
==========================================
  Files         138      138              
  Lines        9108     9101       -7     
==========================================
- Hits         8104     7897     -207     
- Misses       1004     1204     +200     
Flag Coverage Δ
daemon 20.53% <0.00%> (-18.29%) ⬇️
jina 86.72% <76.66%> (-2.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
jina/logging/profile.py 66.10% <ø> (-31.36%) ⬇️
jina/peapods/runtimes/base.py 86.66% <0.00%> (ø)
jina/peapods/runtimes/zmq/zed.py 89.33% <33.33%> (-4.00%) ⬇️
jina/peapods/runtimes/jinad/client.py 75.14% <50.00%> (-1.78%) ⬇️
jina/peapods/zmq/__init__.py 85.46% <50.00%> (ø)
jina/clients/base/__init__.py 86.36% <100.00%> (-4.69%) ⬇️
jina/clients/base/grpc.py 63.82% <100.00%> (-1.48%) ⬇️
jina/clients/base/http.py 88.37% <100.00%> (-2.74%) ⬇️
jina/clients/base/websocket.py 86.36% <100.00%> (+1.58%) ⬆️
jina/flow/base.py 75.09% <100.00%> (-13.84%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c613fa7...c9c7c09. Read the comment docs.

@hanxiao hanxiao merged commit 4540378 into master Jun 25, 2021
@hanxiao hanxiao deleted the feat-suppress-logs branch June 25, 2021 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core This issue/PR affects the core codebase area/network This issue/PR affects network functionality component/client component/flow component/logging component/peapod size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0