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

No color #39

Merged
merged 2 commits into from
Sep 20, 2024
Merged

No color #39

merged 2 commits into from
Sep 20, 2024

Conversation

david-littlefarmer
Copy link
Collaborator

Description

Added simple NoColor for disabling coloring as requested in #38

This code:

func printNoColor() {
	opts := &devslog.Options{
		NoColor: true,
	}

	l := slog.New(devslog.NewHandler(os.Stdout, opts))
	l.Info("msg",
		slog.Any("integer", 1),
		slog.Any("float", 2.2),
		slog.Any("string", "someString"),
		slog.Any("map", map[int]string{3: "three", 4: "four"}),
	)
}

Produce this:
image

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary

@gabyx
Copy link

gabyx commented Sep 20, 2024

@david-littlefarmer : Thats I think perfect. =)

@david-littlefarmer david-littlefarmer merged commit bc1f49c into master Sep 20, 2024
1 check passed
@gabyx
Copy link

gabyx commented Sep 20, 2024

@david-littlefarmer : Cool stuff. Right away using it here:
https://gitlab.com/data-custodian/custodian/-/blob/main/tools/ci-tool/pkg/log/log.go?ref_type=heads

renovate bot referenced this pull request in jippi/dottie Sep 20, 2024
…o.mod (#97)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/golang-cz/devslog](https://redirect.github.com/golang-cz/devslog)
| `v0.0.9` -> `v0.0.11` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgolang-cz%2fdevslog/v0.0.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgolang-cz%2fdevslog/v0.0.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgolang-cz%2fdevslog/v0.0.9/v0.0.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgolang-cz%2fdevslog/v0.0.9/v0.0.11?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>golang-cz/devslog (github.com/golang-cz/devslog)</summary>

###
[`v0.0.11`](https://redirect.github.com/golang-cz/devslog/releases/tag/v0.0.11)

[Compare
Source](https://redirect.github.com/golang-cz/devslog/compare/v0.0.10...v0.0.11)

#### What's Changed

- fix nilString after rebase by
[@&#8203;david-littlefarmer](https://redirect.github.com/david-littlefarmer)
in
[https://github.com/golang-cz/devslog/pull/41](https://redirect.github.com/golang-cz/devslog/pull/41)

**Full Changelog**:
golang-cz/devslog@v0.0.10...v0.0.11

###
[`v0.0.10`](https://redirect.github.com/golang-cz/devslog/releases/tag/v0.0.10):
- Broken

[Compare
Source](https://redirect.github.com/golang-cz/devslog/compare/v0.0.9...v0.0.10)

Broken, use v0.0.11

#### What's Changed

- Remove sync.Mutex pointer by
[@&#8203;VojtechVitek](https://redirect.github.com/VojtechVitek) in
[https://github.com/golang-cz/devslog/pull/37](https://redirect.github.com/golang-cz/devslog/pull/37)
- Fix panic on empty interface field by
[@&#8203;leonid-shevtsov](https://redirect.github.com/leonid-shevtsov)
in
[https://github.com/golang-cz/devslog/pull/40](https://redirect.github.com/golang-cz/devslog/pull/40)
- No color by
[@&#8203;david-littlefarmer](https://redirect.github.com/david-littlefarmer)
in
[https://github.com/golang-cz/devslog/pull/39](https://redirect.github.com/golang-cz/devslog/pull/39)

#### New Contributors

- [@&#8203;leonid-shevtsov](https://redirect.github.com/leonid-shevtsov)
made their first contribution in
[https://github.com/golang-cz/devslog/pull/40](https://redirect.github.com/golang-cz/devslog/pull/40)

**Full Changelog**:
golang-cz/devslog@v0.0.9...v0.0.10

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* */1 * * *" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/jippi/dottie).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants