From 325974c298dfcc123284fe5ec24ab1724723a87a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 1 Jun 2007 07:39:05 +0000 Subject: [PATCH] =?utf8?q?Funktion=20zum=20Dumpen=20von=20Objekten=20via?= =?utf8?q?=20YAML=20hinzugef=C3=BCgt.=20Ist=20manchmal=20besser=20lesbar?= =?utf8?q?=20als=20die=20Ausgabe=20von=20Data::Dumper;?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/LXDebug.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SL/LXDebug.pm b/SL/LXDebug.pm index 6da1a7272..cbb32f9cd 100644 --- a/SL/LXDebug.pm +++ b/SL/LXDebug.pm @@ -14,6 +14,8 @@ use constant STDERR_TARGET => 1; use POSIX qw(strftime); +use YAML; + my $data_dumper_available; our $global_level; @@ -133,6 +135,12 @@ sub dump { } } +sub dump_yaml { + my ($self, $level, $name, $variable) = @_; + + $self->message($level, "dumping ${name}:\n" . YAML::Dump($variable)); +} + sub enable_sub_tracing { my ($self) = @_; $self->{level} | TRACE; -- 2.20.1