Skip to content

Instantly share code, notes, and snippets.

@timo
Created December 12, 2021 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timo/a34409256a10fe49c9cb290adf221771 to your computer and use it in GitHub Desktop.
Save timo/a34409256a10fe49c9cb290adf221771 to your computer and use it in GitHub Desktop.
log output simulator
#!/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