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

Added gmtoff() method in 'LogMessageTime' to get GMT offset #727

Merged
merged 1 commit into from
Dec 9, 2021
Merged

Added gmtoff() method in 'LogMessageTime' to get GMT offset #727

merged 1 commit into from
Dec 9, 2021

Conversation

vijaysattigeri
Copy link
Contributor

closes #707

As per enhancement request attached above, added gmtoff() method in 'LogMessageTime' to get GMT offset.

Rearranged the code to access the variable "FLAGS_log_utc_time" in this file

@google-cla google-cla bot added the cla: yes label Oct 20, 2021
@coveralls
Copy link
Collaborator

coveralls commented Oct 20, 2021

Coverage Status

Coverage increased (+0.06%) to 76.667% when pulling 1fb5429 on vijaythreadtemp:gmt_offset_api into 8b87221 on google:master.

Copy link
Collaborator

@sergiud sergiud left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Unfortunately, there are some build errors.

src/glog/logging.h.in Show resolved Hide resolved
src/glog/logging.h.in Outdated Show resolved Hide resolved
@vijaysattigeri vijaysattigeri marked this pull request as ready for review October 20, 2021 21:30
src/logging_custom_prefix_gmtoffset_unittest.cc Outdated Show resolved Hide resolved
src/logging.cc Outdated Show resolved Hide resolved
src/logging.cc Outdated Show resolved Hide resolved
src/logging_custom_prefix_gmtoffset_unittest.cc Outdated Show resolved Hide resolved
@vijaysattigeri
Copy link
Contributor Author

Hi @sergiud ,

I've added a unit test for my newly added code in the existing file "logging_custom_prefix_unittest.cc". But still "Coverage" check is failing.
Could you please help me here?

Thanks

@sergiud
Copy link
Collaborator

sergiud commented Nov 12, 2021

Thanks! Could you please rebase?

@vijaysattigeri
Copy link
Contributor Author

Hi @sergiud ,

Rebased the branch. Please have a look.

src/logging.cc Outdated Show resolved Hide resolved
src/logging_custom_prefix_unittest.cc Outdated Show resolved Hide resolved
src/logging.cc Outdated Show resolved Hide resolved
src/glog/logging.h.in Outdated Show resolved Hide resolved
const int& dayOfWeek() const { return time_struct.tm_wday; }
const int& dayInYear() const { return time_struct.tm_yday; }
const int& dst() const { return time_struct.tm_isdst; }
LogMessageTime() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can initialize all these members in constructor's initializer list.

@codecov-commenter
Copy link

codecov-commenter commented Dec 7, 2021

Codecov Report

Merging #727 (298f1d5) into master (ee6faf1) will increase coverage by 0.11%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #727      +/-   ##
==========================================
+ Coverage   72.65%   72.76%   +0.11%     
==========================================
  Files          17       17              
  Lines        3211     3224      +13     
==========================================
+ Hits         2333     2346      +13     
  Misses        878      878              
Impacted Files Coverage Δ
src/logging.cc 73.63% <88.09%> (-0.05%) ⬇️
src/glog/logging.h.in 83.13% <100.00%> (+0.85%) ⬆️
src/windows/port.cc 54.54% <0.00%> (+27.27%) ⬆️

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 ee6faf1...298f1d5. Read the comment docs.

@vijaysattigeri
Copy link
Contributor Author

Hi @sergiud ,

Looks like there is some issue with "VS-15-2017-x64-C++11-Release-shared-no-custom-prefix".
It says,

Runner GitHub Actions 293 did not respond to a cancelation request with 00:05:00

Is it possible to rerun this job?

Thanks,
Vijay

src/glog/logging.h.in Outdated Show resolved Hide resolved
src/glog/logging.h.in Outdated Show resolved Hide resolved
Copy link
Collaborator

@sergiud sergiud left a comment

Choose a reason for hiding this comment

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

This looks almost ready to me. I have only minor remarks.

You should also probably add your name to AUTHORS and CONTRIBUTORS files as per contribution guide and eventually squash and rebase onto current master (if not done yet).

src/logging.cc Outdated Show resolved Hide resolved
src/logging_custom_prefix_unittest.cc Outdated Show resolved Hide resolved
    * Added API to get GMT offset
    * Made LogMessageTime as a memeber of LogMessage
    * Refactored LogSink::send() method
@sergiud sergiud added this to the 0.6 milestone Dec 9, 2021
@sergiud
Copy link
Collaborator

sergiud commented Dec 9, 2021

Thanks!

@sergiud sergiud merged commit ef36f80 into google:master Dec 9, 2021
@vijaysattigeri
Copy link
Contributor Author

Hi @sergiud ,

This was my first open source contribution.
Thank you very much for helping me out with code reviews and suggestions.

@sergiud
Copy link
Collaborator

sergiud commented Dec 9, 2021

You're welcome. You did a great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

missing GMT offset in LogMessageTime
4 participants