Skip to content

Use GLOG logging prefixes#40491

Closed
malfet wants to merge 1 commit intopytorch:masterfrom
malfet:malfet/Use-GLOG-logging-prefixes
Closed

Use GLOG logging prefixes#40491
malfet wants to merge 1 commit intopytorch:masterfrom
malfet:malfet/Use-GLOG-logging-prefixes

Conversation

@malfet
Copy link
Copy Markdown
Contributor

@malfet malfet commented Jun 24, 2020

PyTorch should stop polluting global namespace with symbols such as ERROR WARNING and INFO.
Since logging_is_not_google_glog.h is a C++ header, define severity levels in namespace and add GLOG_ prefix to match an unshortened glog severity levels.
Change LOG and LOG_IF macros to use prefix + namespaced severity levels.

Closes #40083

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jun 24, 2020
@malfet malfet force-pushed the malfet/Use-GLOG-logging-prefixes branch 2 times, most recently from df8d0ac to 6654f9e Compare June 24, 2020 05:24
@malfet malfet requested a review from pietern as a code owner June 24, 2020 05:24
@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented Jun 24, 2020

💊 CI failures summary and remediations

As of commit 315aa95 (more details on the Dr. CI page):


None of the CI failures appear to be your fault 💚



🚧 1 fixed upstream failure:

These were probably caused by upstream breakages that were already fixed.

Please rebase on the viable/strict branch (expand for instructions)

Since your merge base is older than viable/strict, run these commands:

git fetch https://github.com/pytorch/pytorch viable/strict
git rebase FETCH_HEAD

Check out the recency history of this "viable master" tracking branch.


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 10 times.

@malfet malfet added better-engineering Relatively self-contained tasks for better engineering contributors triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Jun 24, 2020
@malfet malfet force-pushed the malfet/Use-GLOG-logging-prefixes branch from 6654f9e to 0214e20 Compare June 24, 2020 06:14
@malfet malfet requested review from dzhulgakov, ezyang and orionr and removed request for apaszke, beauby, jiayisuse, lw, osalpekar, pietern and zhaojuanmao June 24, 2020 06:15
@malfet malfet force-pushed the malfet/Use-GLOG-logging-prefixes branch from 0214e20 to 8657088 Compare June 24, 2020 14:31
Also, to further mimic glog, add GLOG_ prefix before severity levels

Play with LOG() LOG_IF() macors to use namespaced and prefixed sevirity levels
@malfet malfet force-pushed the malfet/Use-GLOG-logging-prefixes branch from 8657088 to 315aa95 Compare June 24, 2020 14:35
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@malfet malfet requested a review from dreiss June 24, 2020 17:16
@malfet malfet deleted the malfet/Use-GLOG-logging-prefixes branch June 24, 2020 21:40
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@malfet merged this pull request in fe18dcd.

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
PyTorch should stop polluting global namespace with symbols such as `ERROR` `WARNING` and `INFO`.
Since `logging_is_not_google_glog.h` is a C++ header, define severity levels in namespace and add `GLOG_` prefix to match an unshortened glog severity levels.
Change `LOG` and `LOG_IF` macros to use prefix + namespaced severity levels.

Closes pytorch#40083
Pull Request resolved: pytorch#40491

Test Plan: CI

Reviewed By: ezyang

Differential Revision: D22210925

Pulled By: malfet

fbshipit-source-id: 0ec1181a53baa8bca2f526f245e398582304aeab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

better-engineering Relatively self-contained tasks for better engineering contributors Merged oncall: jit Add this issue/PR to JIT oncall triage queue triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C API pollutes the global namespace

4 participants