Skip to content

UI.Console

Name - Description Default Type
<input> The raw logs. String
<output> The output of this shard will be its input. String
ShowFilters Whether to display filter controls. false Bool
Style The console style. none {Any}Var({Any})

A console with formatted logs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
(GFX.MainWindow
 :Contents
 (->
  (Setup
   (GFX.DrawQueue) >= .ui-draw-queue
   (GFX.UIPass .ui-draw-queue) >> .render-steps)
  (UI
   (->
    (UI.CentralPanel
     (->
      (UI.Button "Say Hello" (Msg "Hello!"))
      (CaptureLog
       :Size 24
       :MinLevel "info"
       :Pattern "%^[%l]%$ [%Y-%m-%d %T.%e] %v")
      (String.Join)
      (UI.Console)))))

  (GFX.Render :Steps .render-steps)))

 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(defloop capture
  (CaptureLog
   :Size 24
   :MinLevel "info"
   :Pattern "%^[%l]%$ [%Y-%m-%d %T.%e] %v"
   :Suspend true)
  (String.Join) > .logs
  (Math.Inc .generation))

(Setup
 "" (Set .logs :Global true)
 0 (Set .generation :Global true)
 (Detach capture))

(GFX.MainWindow
 :Contents
 (->
  (Setup
   (GFX.DrawQueue) >= .ui-draw-queue
   (GFX.UIPass .ui-draw-queue) >> .render-steps)
  (UI
   (->
    (UI.BottomPanel
     :Contents
     (->
      (Get .generation :Global true)
      (ToString) (UI.Label)))
    (UI.CentralPanel
     :Contents
     (->
      (UI.Button "Say Hello" (Msg "Hello!"))
      (Get .logs :Global true)
      (UI.Console :ShowFilters true)))))

  (GFX.Render :Steps .render-steps)))