Skip to content
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

How to change format of logger? for example time and verbose level name and etc #229

Closed
yoni386 opened this issue Aug 10, 2017 · 8 comments · Fixed by #554
Closed

How to change format of logger? for example time and verbose level name and etc #229

yoni386 opened this issue Aug 10, 2017 · 8 comments · Fixed by #554

Comments

@yoni386
Copy link

yoni386 commented Aug 10, 2017

For example:

10-08-2017 15:30:25 [DEBUG] src/ilo/mod.:61 - Hosts to build: ["xxx-local"], total: 1
10-08-2017 15:30:25 [ERROR] src/ilo/ilo_builder/mod.rs:108 - Host: xxx-local Error Msg: [6] Couldn't resolve host name (Could not resolve host: xxx-local)
10-08-2017 15:30:25 [ERROR] src/ilo/mod.rs:73 - Host: xxx-local
10-08-2017 15:30:25 [DEBUG] src/ilo/mod.rs:79 - Total hosts were built:

@xiaodongkirin
Copy link

Hello :
Will the use of vs2015 compiler error, how to solve

@andyleejordan
Copy link
Contributor

@xiaodongkirin your comment doesn't seem related to this issue, and you seem to be spamming all issues.

@andyleejordan
Copy link
Contributor

@yoni386 I looked, and while I don't think you can supply a custom format string, it looks like you can set the log_prefix flag to prepend some information.

@yoni386
Copy link
Author

yoni386 commented Aug 15, 2017 via email

@shinh
Copy link
Collaborator

shinh commented Aug 15, 2017

Note log_prefix is true by default.

Customizable format is unnecessary feature for Google (internal tools depend on this particular format) but I'm happy to accept a PR if someone make this customizable as long as the default code path is kept unchanged.

@santigl
Copy link
Contributor

santigl commented May 15, 2020

#554 contains a possible way of adding support for this.

@santigl
Copy link
Contributor

santigl commented Jul 28, 2020

@shinh: any chance you could take a look at #554 to see what you think of that solution?

@santigl
Copy link
Contributor

santigl commented Nov 5, 2020

As a workaround, we are currently disabling glog's prefix altogether by writing to the FLAGS_log_prefix global variable (this has the benefit of not requiring gflags), and wrapping glog's macros to attach our own prefix.

@sergiud sergiud closed this as completed Mar 30, 2021
@sergiud sergiud linked a pull request Apr 6, 2021 that will close this issue
@sergiud sergiud mentioned this issue May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants