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

Add logger to db and tx. #513

Closed
wants to merge 2 commits into from

Conversation

CaojiamingAlan
Copy link
Contributor

#509
Adopt proposal 1, since I feel it would be very weird to maintain two different kind of logs in the etcd project.
The tx will get the db's logger during initialization.

db.go Outdated Show resolved Hide resolved
Signed-off-by: caojiamingalan <alan.c.19971111@gmail.com>
tx.go Outdated Show resolved Hide resolved
@ahrtr
Copy link
Member

ahrtr commented May 26, 2023

…fore testing the nullity of tx.db, it may panic.

Signed-off-by: caojiamingalan <alan.c.19971111@gmail.com>

var (
discardLogger = &DefaultLogger{Logger: log.New(io.Discard, "", 0)}
bboltLoggerMu sync.Mutex
Copy link
Member

Choose a reason for hiding this comment

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

Mutex is not needed because discardLogger is assigned only once on init.

@cenkalti
Copy link
Member

LGTM if we're going with this proposal but I am against introducing a custom Logger interface. See my comment at #509 (comment) .

Comment on lines +1 to +13
// Copyright 2015 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
Copy link
Member

Choose a reason for hiding this comment

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

There is no copyright header in bbolt. Suggest to remove it, and add a link to https://github.com/etcd-io/raft/blob/main/logger.go

@ahrtr
Copy link
Member

ahrtr commented Jul 31, 2023

@CaojiamingAlan Please resolve the two minor comments above and rebase this PR.

@ahrtr ahrtr removed this from the v1.4.0 milestone Aug 11, 2023
@ahrtr
Copy link
Member

ahrtr commented Nov 6, 2023

@VibhorChinda, since there is no response from the original author, could you resurrect this PR? Suggested rough steps:

  1. Fork a branch on top of this PR, so that the original author is still the author of the first commit;
  2. rebase your PR;
  3. address the comments

@ahrtr
Copy link
Member

ahrtr commented Nov 18, 2023

@VibhorChinda, any update on this?

@Elbehery
Copy link
Member

@ahrtr Hello ✋🏽

i can continue this as well

@VibhorChinda
Copy link

@VibhorChinda, any update on this?

On it @ahrtr
Sorry for late reply. Coming back from a long week PTO.

@Elbehery let's do it together if possible :))

@Elbehery
Copy link
Member

Alright 💪💪

@ahrtr
Copy link
Member

ahrtr commented Nov 27, 2023

superseded by #624

@ahrtr ahrtr closed this Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants