/[cvs]/nfo/perl/libs/DesignPattern/Object.pm
ViewVC logotype

Diff of /nfo/perl/libs/DesignPattern/Object.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by joko, Wed Feb 19 00:36:59 2003 UTC revision 1.10 by joko, Tue May 13 08:46:08 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## ---------------------------------------------------------------------------  ## ---------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.10  2003/05/13 08:46:08  joko
6    ##  pod and comments
7    ##
8    ##  Revision 1.9  2003/03/27 15:44:32  joko
9    ##  fixes/enhancements to 'sub log_basic'
10    ##
11  ##  Revision 1.8  2003/02/19 00:36:59  joko  ##  Revision 1.8  2003/02/19 00:36:59  joko
12  ##  + bugfix: this {logger} is the instance itself, so has to be fed with ( level => xyz and namespace => xyz )  ##  + bugfix: this {logger} is the instance itself, so has to be fed with ( level => xyz and namespace => xyz )
13  ##  + minor modifications in behaviour  ##  + minor modifications in behaviour
# Line 29  Line 35 
35  ##  ##
36  ## ---------------------------------------------------------------------------  ## ---------------------------------------------------------------------------
37    
38    =pod
39    
40    =head1 NAME
41    
42      DesignPattern::Object
43    
44    
45    =head1 TODO
46    
47      o use Class::Loader
48    
49    
50    =cut
51    
52  package DesignPattern::Object;  package DesignPattern::Object;
53    
# Line 165  sub fromPackage { Line 184  sub fromPackage {
184      eval($evstring);      eval($evstring);
185        
186    # report errors    # report errors
187      # Could this be united with DesignPattern::Loader::checkExceptions?
188      if ($@) {      if ($@) {
189        # build error-messages        # build error-messages
190        my $issuer = __PACKAGE__ . ':' . __LINE__;        my $issuer = __PACKAGE__ . ':' . __LINE__;
# Line 185  sub fromPackage { Line 205  sub fromPackage {
205    # object-creation    # object-creation
206      my $object = $pkgname->new(@args);      my $object = $pkgname->new(@args);
207    
208      # trace
209        #print Dumper($object);
210    
211    # run boot-methods on object    # run boot-methods on object
212      $object->_init() if $object->can('_init');      $object->_init() if $object->can('_init');
213      $object->constructor() if $object->can('constructor');      $object->constructor() if $object->can('constructor');
# Line 200  sub log_basic { Line 223  sub log_basic {
223    #return;    #return;
224    $level ||= 'info';    $level ||= 'info';
225    
226    if ($_dp_globals->{TRACE} || ($level && $level =~ /warning|error|critical/)) {    my $notSoGood = ($level =~ /warning|error|critical/);
227      
228      # STDERR?
229      if ($level && $notSoGood) {
230        print STDERR $level, ": ", $message, "\n";
231      }
232    
233      # STDOUT?
234      if ($_dp_globals->{TRACE} || $notSoGood) {
235      print $level, ": ", $message, "\n";      print $level, ": ", $message, "\n";
236    }    }
237    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.10

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed