Skip to content

Fix #5488: change default for logging to +nowrap #9160

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tests = testGroup "Distribution.Utils.Structured"
, testCase "GenericPackageDescription" $
md5Check (Proxy :: Proxy GenericPackageDescription) 0x6ad1e12c6f88291e9b8c131d239eda70
, testCase "LocalBuildInfo" $
md5Check (Proxy :: Proxy LocalBuildInfo) 0xbc7ac84a9bc43345c812af222c3e5ba0
md5Check (Proxy :: Proxy LocalBuildInfo) 0xca172408aaecfdda2052714e969563cb
#endif
]

Expand Down
20 changes: 16 additions & 4 deletions Cabal/src/Distribution/Verbosity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ module Distribution.Verbosity
-- * Line wrapping
, verboseNoWrap
, isVerboseNoWrap
, verboseWrap
, isVerboseWrap

-- * Time stamps
, verboseTimestamp
Expand Down Expand Up @@ -229,7 +231,9 @@ parsecVerbosity = parseIntVerbosity <|> parseStringVerbosity
case token of
"callsite" -> return verboseCallSite
"callstack" -> return verboseCallStack
"nowrap" -> return verboseNoWrap
"nowrap" -> return verboseNoWrap -- This is the (new) default, but we
-- choose to not make the CLI break when using the legacy `+nowrap` arg.
"wrap" -> return verboseWrap
"markoutput" -> return verboseMarkOutput
"timestamp" -> return verboseTimestamp
"stderr" -> return verboseStderr
Expand Down Expand Up @@ -257,7 +261,7 @@ showForCabal v

showFlag VCallSite = ["+callsite"]
showFlag VCallStack = ["+callstack"]
showFlag VNoWrap = ["+nowrap"]
showFlag VWrap = ["+wrap"]
showFlag VMarkOutput = ["+markoutput"]
showFlag VTimestamp = ["+timestamp"]
showFlag VStderr = ["+stderr"]
Expand Down Expand Up @@ -289,7 +293,11 @@ verboseUnmarkOutput = verboseNoFlag VMarkOutput

-- | Disable line-wrapping for log messages.
verboseNoWrap :: Verbosity -> Verbosity
verboseNoWrap = verboseFlag VNoWrap
verboseNoWrap = verboseNoFlag VWrap

-- | Enable line-wrapping for log messages.
verboseWrap :: Verbosity -> Verbosity
verboseWrap = verboseFlag VWrap

-- | Mark the verbosity as quiet.
verboseQuiet :: Verbosity -> Verbosity
Expand Down Expand Up @@ -348,7 +356,11 @@ isVerboseMarkOutput = isVerboseFlag VMarkOutput

-- | Test if line-wrapping is disabled for log messages.
isVerboseNoWrap :: Verbosity -> Bool
isVerboseNoWrap = isVerboseFlag VNoWrap
isVerboseNoWrap = not . isVerboseWrap

-- | Test if line-wrapping is enabled for log messages.
isVerboseWrap :: Verbosity -> Bool
isVerboseWrap = isVerboseFlag VWrap

-- | Test if we had called 'lessVerbose' on the verbosity.
isVerboseQuiet :: Verbosity -> Bool
Expand Down
3 changes: 2 additions & 1 deletion Cabal/src/Distribution/Verbosity/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ instance Structured VerbosityLevel
data VerbosityFlag
= VCallStack
| VCallSite
| VNoWrap
| VMarkOutput
| VTimestamp
| -- | @since 3.4.0.0
VStderr
| VNoWarn
| -- | @since 3.12.1.0
VWrap
deriving (Generic, Show, Read, Eq, Ord, Enum, Bounded, Typeable)

instance Binary VerbosityFlag
Expand Down