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

Hi, my friend, I found a bug, but I don't know how to fix it. #1

Closed
DarkiT opened this issue Jul 23, 2024 · 3 comments
Closed

Hi, my friend, I found a bug, but I don't know how to fix it. #1

DarkiT opened this issue Jul 23, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@DarkiT
Copy link

DarkiT commented Jul 23, 2024

Hi, my friend, I found a bug, but I don't know how to fix it.

  logger := sslog.New(humane.NewHandler(os.Stdout, nil))
  logger.Info("My informative message", "foo", "bar", "bizz", "buzz")
  logger.Error("Ooops", slog.Any("error", fmt.Errorf("xxxx")))

Expected output

  // Output:
  //  INFO | My informative message | foo=bar bizz=buzz time="2023-04-02T10:50.09 EDT"
  // ERROR | Ooops | error="error message" time="2023-04-02T10:50.09 EDT"

Actual output

  // Output:
 INFO | My informative message | foo=bar bizz=buzz time="2024-07-23T02:37.02 CST"
 INFO | Ooops | error=xxxx time="2024-07-23T02:37.02 CST" 
@telemachus telemachus self-assigned this Jul 23, 2024
@telemachus telemachus added the bug Something isn't working label Jul 23, 2024
@telemachus
Copy link
Owner

Thank you! This was a very dumb bug: I was displaying the handler's level (which does not normally change) instead of the level of the specific record.

I have a fix, and I added tests for the problem. I should update sometime today. (I want to check things over just in case.) Thanks again for the report.

@telemachus
Copy link
Owner

@DarkiT I just uploaded a fix. Let me know if it gives you any trouble. Otherwise, I'll close this soon. Thanks again for the bug report.

@DarkiT
Copy link
Author

DarkiT commented Jul 24, 2024

@DarkiT I just uploaded a fix. Let me know if it gives you any trouble. Otherwise, I'll close this soon. Thanks again for the bug report.

It now looks to be working perfectly. Thank you for your contribution.

@DarkiT DarkiT closed this as completed Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants