- New LogLevel type: Debug, Info, Warn, Error with Ord instance - Logger holds configured level and output handle (stderr or file) - --log-level and --log-file CLI flags - log_level and log_file YAML config fields - Log messages assigned appropriate severity levels - Test logger updated to new Logger structure - All 17 tests passing
This commit is contained in:
+4
-3
@@ -16,12 +16,13 @@ module TestHelper (
|
||||
) where
|
||||
|
||||
import Control.Concurrent.MVar (newMVar)
|
||||
import Converge (Logger (..))
|
||||
import Converge (Logger (..), LogLevel (..))
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
import System.Directory (createDirectory)
|
||||
import System.Exit (ExitCode)
|
||||
import System.FilePath ((</>))
|
||||
import System.IO (stderr)
|
||||
import System.IO.Temp (withSystemTempDirectory)
|
||||
import System.Process (readProcessWithExitCode)
|
||||
|
||||
@@ -37,9 +38,9 @@ rawGit args = do
|
||||
(code, out, err) <- readProcessWithExitCode "git" args ""
|
||||
pure (code, T.pack out, T.pack err)
|
||||
|
||||
-- | Create a test logger (serialized writes to stderr).
|
||||
-- | Create a test logger (serialized writes to stderr, Debug level).
|
||||
testLogger :: IO Logger
|
||||
testLogger = Logger <$> newMVar ()
|
||||
testLogger = Logger <$> newMVar () <*> pure Debug <*> pure stderr
|
||||
|
||||
{- | Create a temporary git repository, configure a user, make an initial
|
||||
commit on branch "main", run the action with the repo path, then clean up.
|
||||
|
||||
Reference in New Issue
Block a user