From 1eec4efb0326050339476d41ee3c5bddf27ac183 Mon Sep 17 00:00:00 2001 From: sahara-ooga <26447279+sahara-ooga@users.noreply.github.com> Date: Fri, 20 May 2022 01:27:00 +0900 Subject: [PATCH 1/2] fix to make the string being attached to coloredLogStream colored again --- Sources/Public/Pretty.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/Public/Pretty.swift b/Sources/Public/Pretty.swift index b501101..f4a0cbc 100644 --- a/Sources/Public/Pretty.swift +++ b/Sources/Public/Pretty.swift @@ -305,7 +305,14 @@ extension Pretty { option: Option ) { let plainString = printer(label, targets, separator, option) - let coloredString = printer(label, targets, separator, option) + + let coloredOption: Option = { + var op = option + op.colored = true + return op + }() + + let coloredString = printer(label, targets, separator, coloredOption) // Console Swift.print(option.colored ? coloredString : plainString) From 7582ec541c146644aad29090a88044299f0b839b Mon Sep 17 00:00:00 2001 From: Ogasawara Yuu Date: Fri, 20 May 2022 19:38:58 +0900 Subject: [PATCH 2/2] Refactor --- Sources/Public/Pretty.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Sources/Public/Pretty.swift b/Sources/Public/Pretty.swift index f4a0cbc..db8f88f 100644 --- a/Sources/Public/Pretty.swift +++ b/Sources/Public/Pretty.swift @@ -306,12 +306,8 @@ extension Pretty { ) { let plainString = printer(label, targets, separator, option) - let coloredOption: Option = { - var op = option - op.colored = true - return op - }() - + var coloredOption = option + coloredOption.colored = true let coloredString = printer(label, targets, separator, coloredOption) // Console