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

Updated Meshkit logger docs #11202

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

Aviral0702
Copy link
Contributor

@Aviral0702 Aviral0702 commented Jun 17, 2024

Signed-off-by: Aviral0702 aviral.asthana0704@gmail.com

Notes for Reviewers

This PR fixes #11194
Current Behavior:
image

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Aviral0702 <aviral.asthana0704@gmail.com>
@github-actions github-actions bot added the area/docs Documentation update needed label Jun 17, 2024
Copy link

github-actions bot commented Jun 17, 2024

@l5io
Copy link
Collaborator

l5io commented Jun 17, 2024

@@ -145,7 +145,7 @@ func main() {
DebugLevel: true,
})
if err != nil {
fmt.Println(err)
logrus.Error(err)
Copy link
Member

Choose a reason for hiding this comment

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

We're looking for MeshKit logger, not logrus, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry @leecalcote for that. I think I misunderstood the task.

Copy link
Member

Choose a reason for hiding this comment

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

@singh1203 will you offer some direction?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, @Aviral0702 we are in motion to get rid of logrus with Meshkit logger.

@leecalcote leecalcote requested review from Jougan-0 and removed request for Jougan-0 June 17, 2024 19:34
Copy link
Contributor

@singh1203 singh1203 left a comment

Choose a reason for hiding this comment

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

You might give it a read to starting para's of this particular doc itself.

@@ -145,7 +145,7 @@ func main() {
DebugLevel: true,
})
if err != nil {
fmt.Println(err)
logrus.Error(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, @Aviral0702 we are in motion to get rid of logrus with Meshkit logger.

@@ -145,7 +145,7 @@ func main() {
DebugLevel: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

well issue also points to hint in example for LogLevel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I use LogLevel instead of DebugLevel there ?

Copy link
Contributor

Choose a reason for hiding this comment

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

LogLevel: logLevel,

Signed-off-by: Aviral0702 <aviral.asthana0704@gmail.com>
@l5io
Copy link
Collaborator

l5io commented Jun 18, 2024

@@ -142,10 +142,10 @@ var (
func main() {
log, err := logger.New("test", logger.Options{
Format: logger.SyslogLogFormat,
DebugLevel: true,
LogLevel: logLevel,
Copy link
Contributor

Choose a reason for hiding this comment

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

maintain the indentation

Signed-off-by: Aviral0702 <aviral.asthana0704@gmail.com>
@l5io
Copy link
Collaborator

l5io commented Jun 18, 2024

Signed-off-by: Aviral0702 <aviral.asthana0704@gmail.com>
@l5io
Copy link
Collaborator

l5io commented Jun 18, 2024

@l5io
Copy link
Collaborator

l5io commented Jun 18, 2024

@@ -142,7 +142,7 @@ var (
func main() {
log, err := logger.New("test", logger.Options{
Format: logger.SyslogLogFormat,
DebugLevel: true,
LogLevel: logLevel,
Copy link
Contributor

Choose a reason for hiding this comment

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

@Aviral0702 Good job utilizing the loglevel here, but do you know what it is? Is it a variable or a string?

If it is a variable, does it have a value assigned to it?
Answer: Refer to the example provided under the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, It is an integer. First of all it is assigned with the value of LOG_LEVEL and there is a check for DEBUG_LEVEL which returns a bool value if it comes out to be true then then the value of logLevel is assigned with the value of debugLevel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done with the help of Viper framework of Golang.

@l5io
Copy link
Collaborator

l5io commented Jun 19, 2024

@Aviral0702 Aviral0702 force-pushed the master branch 2 times, most recently from 1ff6675 to b352a6c Compare June 19, 2024 09:28
@l5io
Copy link
Collaborator

l5io commented Jun 19, 2024

@l5io
Copy link
Collaborator

l5io commented Jun 19, 2024

@@ -142,7 +142,7 @@ var (
func main() {
log, err := logger.New("test", logger.Options{
Copy link
Contributor

@singh1203 singh1203 Jun 20, 2024

Choose a reason for hiding this comment

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

@Aviral0702 You can take a look to this example set the logLevel from here

Signed-off-by: Aviral0702 <aviral.asthana0704@gmail.com>
@l5io
Copy link
Collaborator

l5io commented Jun 21, 2024

Copy link
Contributor

@singh1203 singh1203 left a comment

Choose a reason for hiding this comment

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

LGTM!

@l5io
Copy link
Collaborator

l5io commented Jun 21, 2024

@@ -140,9 +142,13 @@ var (
)
Copy link
Contributor

Choose a reason for hiding this comment

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

After the recent meshkit release we don't show panic error anymore so if you replace that part too it would be great.
Else current update LGTM.
Screenshot from 2024-06-21 20-45-12

Try to run this code provided and see what does it show and please replace it if you would.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the review. I am trying to implement the changes as you said.

@l5io
Copy link
Collaborator

l5io commented Jun 21, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Documentation update needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Docs] Update Meskit Logger Docs
5 participants