diff options
author | Jonas Smedegaard <dr@jones.dk> | 2024-09-02 18:04:41 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2024-09-02 18:04:41 +0200 |
commit | f390cdcf15982f5843b24eeee30e0603d869acb8 (patch) | |
tree | 4eda7c8ef0e355e12e150af93beed4ef6e3bd03b | |
parent | 90acc299abf502f2e309661996f7ee43a03358e2 (diff) |
omit debug log for non-coerced locale or time zone
-rw-r--r-- | lib/Object/Groupware.pm | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/Object/Groupware.pm b/lib/Object/Groupware.pm index a49b47b..405ac04 100644 --- a/lib/Object/Groupware.pm +++ b/lib/Object/Groupware.pm @@ -16,19 +16,22 @@ field $dt_time_zone : param : reader = undef; field $dt_span_time_prefix : param : reader = ''; ADJUST { - if ( defined $self->dt_locale ) { - $dt_locale = DateTime::Locale->load( $self->dt_locale ) - unless $self->dt_locale isa DateTime::Locale::FromData; + if ( defined $self->dt_locale + and not $self->dt_locale isa DateTime::Locale::FromData ) + { + $dt_locale = DateTime::Locale->load( $self->dt_locale ); $log->debugf( - 'Object %s locale: %s (%s)', + 'Coerced object %s locale: %s (%s)', __CLASS__, $self->dt_locale->code, $self->dt_locale->name ); } - if ( defined $self->dt_time_zone ) { - $dt_time_zone = DateTime::TimeZone->new( name => $self->dt_time_zone ) - unless $self->dt_time_zone isa DateTime::TimeZone; + if ( defined $self->dt_time_zone + and not $self->dt_time_zone isa DateTime::TimeZone ) + { + $dt_time_zone + = DateTime::TimeZone->new( name => $self->dt_time_zone ); $log->debugf( - 'Object %s time zone: %s', + 'Coerced object %s time zone: %s', __CLASS__, $self->dt_time_zone->name ); } |