generated from tpl/purs
fix: strict build, fix pretty rendering
This commit is contained in:
parent
c80536d698
commit
135348af98
1334
spago.lock
Normal file
1334
spago.lock
Normal file
File diff suppressed because it is too large
Load Diff
12
spago.yaml
12
spago.yaml
@ -1,4 +1,7 @@
|
||||
package:
|
||||
build:
|
||||
strict: true
|
||||
pedantic_packages: true
|
||||
dependencies:
|
||||
- aff
|
||||
- arrays
|
||||
@ -30,16 +33,11 @@ package:
|
||||
- tailrec
|
||||
- transformers
|
||||
- unlift
|
||||
name: project
|
||||
name: logging
|
||||
workspace:
|
||||
extra_packages:
|
||||
sync:
|
||||
dependencies:
|
||||
- aff
|
||||
- arrays
|
||||
- avar
|
||||
git: https://git.orionkindel.com/orion/purescript-sync.git
|
||||
ref: 'fe21a2e'
|
||||
package_set:
|
||||
url: https://raw.githubusercontent.com/purescript/package-sets/psc-0.15.10-20230930/packages.json
|
||||
hash: sha256-nTsd44o7/hrTdk0c6dh0wyBqhFFDJJIeKdQU6L1zv/A=
|
||||
registry: 47.7.1
|
||||
|
@ -12,7 +12,7 @@ import Data.JSDate as Date
|
||||
import Data.List (List)
|
||||
import Data.List as List
|
||||
import Data.Log.Types (Actor(..), Level(..), Log, actor, context, level, message)
|
||||
import Data.Maybe (Maybe(..), fromMaybe)
|
||||
import Data.Maybe (Maybe(..), maybe)
|
||||
import Data.Newtype (unwrap)
|
||||
import Effect (Effect)
|
||||
import Effect.Aff (Aff)
|
||||
@ -36,8 +36,10 @@ pretty log =
|
||||
Info -> "[INFO ]"
|
||||
Warn -> "[WARN ]"
|
||||
Error -> "[ERROR]"
|
||||
actor' = case actor log of Actor { thread } -> fromMaybe "" thread
|
||||
context' = (\{ path: p, context: cs } -> show p <> " " <> (intercalate " > " cs)) $ Array.NonEmpty.last $ context log
|
||||
actor' = case actor log of Actor { thread } -> maybe "" (\s -> "[" <> s <> "]") thread
|
||||
context'' {path: p, context: []} = "[" <> p <> "]"
|
||||
context'' {path: p, context: cs} = "[" <> p <> "](" <> intercalate " > " cs <> ")"
|
||||
context' = context'' $ Array.NonEmpty.last $ context log
|
||||
in
|
||||
intercalate "" [ level', actor', context', message log ]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user