From a1b138e5e187cc519043b36c2699c04a3de6cd49 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Thu, 23 Feb 2023 05:39:12 +1300 Subject: [PATCH] vncserver: support Logger debug level --- unix/KasmVNC/Logger.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/unix/KasmVNC/Logger.pm b/unix/KasmVNC/Logger.pm index b8e64af..e5ab497 100644 --- a/unix/KasmVNC/Logger.pm +++ b/unix/KasmVNC/Logger.pm @@ -8,9 +8,18 @@ use Data::Dumper; sub new { my ($class, $args) = @_; my $self = bless { + level => $args->{level} // "warn" }, $class; } +sub debug { + my $self = shift; + + return unless ($self->{level} eq "debug"); + + say { *STDERR } @_; +} + sub warn { my $self = shift;