-
Notifications
You must be signed in to change notification settings - Fork 636
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
Conversation
Signed-off-by: caojiamingalan <alan.c.19971111@gmail.com>
…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 |
There was a problem hiding this comment.
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.
LGTM if we're going with this proposal but I am against introducing a custom Logger interface. See my comment at #509 (comment) . |
// 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. |
There was a problem hiding this comment.
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
@CaojiamingAlan Please resolve the two minor comments above and rebase this PR. |
@VibhorChinda, since there is no response from the original author, could you resurrect this PR? Suggested rough steps:
|
@VibhorChinda, any update on this? |
@ahrtr Hello ✋🏽 i can continue this as well |
On it @ahrtr @Elbehery let's do it together if possible :)) |
Alright 💪💪 |
superseded by #624 |
#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.