#lang racket/base
;; For legal info, see file "info.rkt".

(require "rackonsole.rkt")

(thread (lambda ()
          (rackonsole #:title         "Rackonsole Demo"
                      #:capture-level 'debug
                      #:view-level    'warning
                      #:quit-proc     exit)))

(define (random-string . args)
  (list-ref args (random (length args))))

(let loop ()
  (sleep (random 5))
  (case (random 8)
    ((0) (log-fatal

           "A problem has been detected and Windows has been shut down to prevent damage to your computer."
           "Charlie was a chemist, but Charlie is no more. What Charlie thought was H2O, was H2SO4."
           "Core dumped."
           "Divided by zero! For real!"
           "Dogs and cats, living together! Mass hysteria!"
           "Oh, the humanity!"
           "Stop. Hammertime!"
           "This copy of Racket is pirated!"
           "kernel panic"

    ((1) (log-error

           "An error has occurred while creating an error report."
           "An error occurred while displaying the previous error."
           "Attempted to divide by zero."
           "Found infected file: \"Microsoft Windows\". Remove it?"
           "Keyboard not responding. Press any key to continue."
           "NET_SendPacket ERROR: NO ERROR"
           "Something bad."
           "That would be a grave mistake."
           "The operation completed successfully."
           "Windows 95 was unable to detect your keyboard. Press F1 to retry or F2 to abort."
           "You have not gotten any error mesages recently, so here is a random one just to let you know that we haven't started caring."

    ((2) (log-warning

           "BPA in canned food."
           "BPA on grocery receipts."
           "Computer running low on oil. Add 10W-40 through top vent."
           "For every complex problem there is an answer that is clear, simple, and wrong."
           "I don't try to describe the future. I try to prevent it."
           "I have a bad feeling about this."
           "I'm all out of bubblegum."
           "I'm all out of love."
           "My name is Inigo Montoya. You killed my father. Prepare to die."
           "You are running with scissors."
           "return value of printf not casted to void"

    ((3) (log-debug

           "Rackonsole, Rackonsole, let down your hair!"
           "Someone left in a debugging message."

    (else (log-info

            "(= (+ 2 2) 4)"
            "All work and no play makes Jack a dull boy."
            "And when we go, nature will start again. With the bees, probably."
            "Controversy equalizes fools and wise men -- and the fools know it."
            "Every child must eat a pound of dirt."
            "GOTO considered harmful."
            "He has half the deed done who has made a beginning."
            "It is impossible to imagine Goethe or Beethoven being good at billiards or golf."
            "It is the province of knowledge to speak, and it is the privilege of wisdom to listen."
            "Rock-on soul."
            "Seitan is great for stir-fry."
            "There are a lot of decaffeinated brands on the market today that are just as tasty as the real thing."