We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, it works with standard string formatter:
testMap := map[string]any{ "key1": "value1", "key2": "value2", } logger.Info("message", slog.Any("test", testMap)) logger.Info("message", slog.Any("test", TestMap{Key1: "value1", Key2: "value2"}))
2025-01-30 12:31:23 INF message test=map[key1:value1 key2:value2] 2025-01-30 12:31:23 INF message test={value1 value2}
What about adding config parameter to the handler to allow json marshal with or without indentation It can looks like
marshaledMap, _ := json.MarshalIndent(testMap, "", " ") logger.Info("message", slog.String("test", string(marshaledMap)))
2025-01-30 12:31:23 INF message test={ "key1": "value1", "key2": "value2" }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, it works with standard string formatter:
What about adding config parameter to the handler to allow json marshal with or without indentation
It can looks like
The text was updated successfully, but these errors were encountered: