-
-
Save timo/a34409256a10fe49c9cb290adf221771 to your computer and use it in GitHub Desktop.
log output simulator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env raku | |
my @w = slurp("/usr/share/dict/words").lines; | |
my $levels = Bag.new-from-pairs((:10DEBUG, :4INFO, :2WARN, :1ERROR)); | |
sub m { | |
"$(DateTime.now) $levels.pick() @w.pick((3..15).pick())" | |
} | |
loop { | |
say m; | |
sleep (0.2 .. 2).rand; | |
$*OUT.flush; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment