aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PursLoader/Loader.purs
diff options
context:
space:
mode:
authoreric thul <thul.eric@gmail.com>2016-02-27 20:15:10 -0500
committereric thul <thul.eric@gmail.com>2016-02-27 20:15:10 -0500
commit3afbe2fddcc38ba6d79b01409f57158a217c00dd (patch)
tree7fbfb8f3bf11a3f3b5fbff95e58acdb8a6724627 /src/PursLoader/Loader.purs
parent861ae3407e82b2ef0fd08f6d4ff7f2b0df0b3ed7 (diff)
downloadpurs-loader-3afbe2fddcc38ba6d79b01409f57158a217c00dd.tar.gz
purs-loader-3afbe2fddcc38ba6d79b01409f57158a217c00dd.tar.zst
purs-loader-3afbe2fddcc38ba6d79b01409f57158a217c00dd.zip
Adding debug logging
Diffstat (limited to 'src/PursLoader/Loader.purs')
-rw-r--r--src/PursLoader/Loader.purs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/PursLoader/Loader.purs b/src/PursLoader/Loader.purs
index f78153f..5e00f7e 100644
--- a/src/PursLoader/Loader.purs
+++ b/src/PursLoader/Loader.purs
@@ -34,6 +34,7 @@ import PursLoader.LoaderRef
34 , resourcePath 34 , resourcePath
35 ) 35 )
36 36
37import PursLoader.Debug (debug)
37import PursLoader.LoaderUtil (parseQuery) 38import PursLoader.LoaderUtil (parseQuery)
38import PursLoader.Options (Options(..)) 39import PursLoader.Options (Options(..))
39import PursLoader.Path (dirname, relative) 40import PursLoader.Path (dirname, relative)
@@ -47,6 +48,8 @@ loader ref source = do
47 48
48 cacheable ref 49 cacheable ref
49 50
51 debug "Invoke PureScript plugin compilation"
52
50 pluginContext.compile (compile callback) 53 pluginContext.compile (compile callback)
51 where 54 where
52 pluginContext :: Plugin.Context (Effects eff) 55 pluginContext :: Plugin.Context (Effects eff)
@@ -56,6 +59,8 @@ loader ref source = do
56 compile callback error' { srcMap, ffiMap, graph } = do 59 compile callback error' { srcMap, ffiMap, graph } = do
57 clearDependencies ref 60 clearDependencies ref
58 61
62 either (const $ pure unit) (\a -> debug ("Adding PureScript dependency " ++ a)) name
63
59 addDependency ref (resourcePath ref) 64 addDependency ref (resourcePath ref)
60 65
61 either (\err -> callback (Just err) "") id 66 either (\err -> callback (Just err) "") id
@@ -63,6 +68,7 @@ loader ref source = do
63 where 68 where
64 handle :: String -> Array String -> String -> Eff (Effects eff) Unit 69 handle :: String -> Array String -> String -> Eff (Effects eff) Unit
65 handle name' deps res = do 70 handle name' deps res = do
71 debug ("Adding PureScript transitive dependencies for " ++ name')
66 addTransitive name' 72 addTransitive name'
67 foreachE deps addTransitive 73 foreachE deps addTransitive
68 callback (toMaybe error') res 74 callback (toMaybe error') res