Skip to content

Msg

Name - Description Default Type
<input> Any
<output> Any
Message The message to display on the user's screen or console. "" String
Level The level of logging. LogLevel.Info LogLevel

Displays the passed message string or the passed variable's value to the user via standard output.

Details

This shard is used for displaying messages to the user on the standard output (which is usually the console).

The message to display can be passed to this shard either as a string or as a variable holding a value. In case a variable is passed the shard displays the variable's value.

Examples

1
2
3
4
5
6
(defshards msgshard [a b]
  (Msg a)  ;; print value of 1st arg passed
  (Msg b)) ;; print value of 2nd arg passed

(Msg "Hello World") ;; prints string
(msgshard "Bye" "Universe") ;; prints args passed
[info] Ignoring value inside a wire definition: #user-function(0000025121655A80) ignore this warning if this was intentional.
[info] [shards/General/Msg/1.edn] Hello World
[info] [shards/General/Msg/1.edn] Bye
[info] [shards/General/Msg/1.edn] Universe

 

1
2
3
4
5
6
(defshards msgshard [a b]
  (Msg a LogLevel.Warning)  ;; print value of 1st arg passed
  (Msg b LogLevel.Error)) ;; print value of 2nd arg passed

(Msg "Hello World" LogLevel.Info) ;; prints string
(msgshard "Bye" "Universe") ;; prints args passed
[info] Ignoring value inside a wire definition: #user-function(000001F0AD0A1020) ignore this warning if this was intentional.
[info] [shards/General/Msg/2.edn] Hello World
[warning] [shards/General/Msg/2.edn] Bye
[error] [shards/General/Msg/2.edn] Universe