@@ -61,6 +61,7 @@ dependency, and setup an alias to execute it.
61
61
To achieve this, create a new `deps.edn` file with the following
62
62
content:
63
63
64
+ .deps.edn
64
65
[,clojure]
65
66
----
66
67
{:deps {org.clojure/clojure {:mvn/version "1.12.0"}
@@ -110,8 +111,9 @@ $ duct --init
110
111
Created duct.edn
111
112
----
112
113
113
- This will create a file, `duct.edn` with the content:
114
+ This will create a file: `duct.edn`.
114
115
116
+ .duct.edn
115
117
[,clojure]
116
118
----
117
119
{:system {}}
@@ -121,8 +123,9 @@ This will create a file, `duct.edn` with the content:
121
123
122
124
As mentioned previously, Duct uses a file, `duct.edn`, to define the
123
125
structure of your application. We'll begin by adding a new component
124
- key to the system:
126
+ key to the system.
125
127
128
+ .duct.edn
126
129
[,clojure]
127
130
----
128
131
{:system
@@ -152,6 +155,7 @@ mkdir -p src/tutorial
152
155
153
156
Then a minimal Clojure file at: `src/tutorial/print.clj`.
154
157
158
+ .src/tutorial/print.clj
155
159
[,clojure]
156
160
----
157
161
(ns tutorial.print)
@@ -231,8 +235,9 @@ A *module* groups multiple components together. Duct provides a number
231
235
of pre-written modules that implement common functionality. One of these
232
236
modules is `:duct.module/logging`.
233
237
234
- We'll first add the dependency to `deps.edn`.
238
+ We'll first add the new dependency:
235
239
240
+ .deps.edn
236
241
[,clojure]
237
242
----
238
243
{:deps {org.clojure/clojure {:mvn/version "1.12.0"}
@@ -241,8 +246,9 @@ We'll first add the dependency to `deps.edn`.
241
246
:aliases {:duct {:main-opts ["-m" "duct.main"]}}}
242
247
----
243
248
244
- Then we'll add the module to the `duct.edn` configuration.
249
+ Then we'll add the module to the Duct configuration.
245
250
251
+ .duct.edn
246
252
[,clojure]
247
253
----
248
254
{:system
@@ -290,6 +296,7 @@ to a file, `logs/repl.log`.
290
296
In order to use this module, we need to connect the logger to our
291
297
'`hello`' component. This is done via a *ref*.
292
298
299
+ .duct.edn
293
300
[,clojure]
294
301
----
295
302
{:system
@@ -310,6 +317,7 @@ applications.
310
317
Now that we've connected the components together in the configuration
311
318
file, it's time to replace the `println` function with the Duct logger.
312
319
320
+ .src/tutorial/print.clj
313
321
[,clojure]
314
322
----
315
323
(ns tutorial.print
@@ -356,6 +364,7 @@ environment variable or command line option. Duct allows variables, or
356
364
Currently our application outputs the same log message each time it's
357
365
run. Let's create a configuration var to customize that behavior.
358
366
367
+ .duct.edn
359
368
[,clojure]
360
369
----
361
370
{:vars
@@ -370,6 +379,7 @@ run. Let's create a configuration var to customize that behavior.
370
379
Then in the source file we can add the `:name` option that the var is
371
380
attached to.
372
381
382
+ .src/tutorial/print.clj
373
383
[,clojure]
374
384
----
375
385
(ns tutorial.print
@@ -434,6 +444,7 @@ behavior to the environment they're being run under. We can also use the
434
444
435
445
Let's change our component to allow for the log level to be specified.
436
446
447
+ .src/tutorial/print.clj
437
448
[,clojure]
438
449
----
439
450
(ns tutorial.print
@@ -446,6 +457,7 @@ Let's change our component to allow for the log level to be specified.
446
457
In `duct.edn` we can use a profile to change the log level depending
447
458
on whether the application uses the `:main` or `:repl` profile.
448
459
460
+ .deps.edn
449
461
[,clojure]
450
462
----
451
463
{:vars
0 commit comments