Commit 3f3d6c82 authored by Leo Gordon's avatar Leo Gordon
Browse files

went back to printing toString() when registering new Cacheable objects

parent 513dfa4e
...@@ -243,7 +243,7 @@ sub dataflow_rules_collection { ...@@ -243,7 +243,7 @@ sub dataflow_rules_collection {
sub toString { sub toString {
my $self = shift @_; my $self = shift @_;
return ('Analysis: '.join(', ', map { $_.'="'.$self->$_().'"' } qw(dbID logic_name module parameters) )); return 'Analysis['.($self->dbID // '').']: '.$self->display_name.'->('.join(', ', $self->module, $self->parameters, $self->resource_class->name).')';
} }
1; 1;
......
...@@ -153,11 +153,9 @@ sub toString { ...@@ -153,11 +153,9 @@ sub toString {
my $self = shift; my $self = shift;
return join('', return join('',
'AnalysisCtrlRule', 'AnalysisCtrlRule: ',
# '(dbID=', ($self->dbID || '?'), ')', # this object doesn't have a dbID
': ',
$self->condition_analysis_url, $self->condition_analysis_url,
' -| ', ' ---| ',
$self->ctrled_analysis->logic_name, $self->ctrled_analysis->logic_name,
); );
} }
......
...@@ -50,8 +50,6 @@ sub add_new_or_update { ...@@ -50,8 +50,6 @@ sub add_new_or_update {
} else { } else {
warn "Found a matching $class (".Dumper(\%unikey_pairs).")\n"; warn "Found a matching $class (".Dumper(\%unikey_pairs).")\n";
} }
} else {
warn "Creating a new $class (".Dumper(\%unikey_pairs).")\n";
} }
} else { } else {
warn "$class doesn't redefine unikey(), so unique objects cannot be identified"; warn "$class doesn't redefine unikey(), so unique objects cannot be identified";
...@@ -60,8 +58,10 @@ sub add_new_or_update { ...@@ -60,8 +58,10 @@ sub add_new_or_update {
unless( $self ) { unless( $self ) {
if( $class->can('new') ) { if( $class->can('new') ) {
$self = $class->new( @_ ); $self = $class->new( @_ );
warn "Created a new ".$self->toString."\n";
} else { } else {
$self = { @_ }; $self = { @_ };
warn "Created a new naked entry ".stringify($self)."\n";
} }
$class->collection()->add( $self ); $class->collection()->add( $self );
......
...@@ -192,19 +192,22 @@ sub to_analysis { ...@@ -192,19 +192,22 @@ sub to_analysis {
=cut =cut
sub toString { sub toString {
my $self = shift; my $self = shift @_;
my $short = shift @_;
return join('', return join('',
'DataflowRule(dbID=', $short ? () : (
($self->dbID || '?'), 'DataflowRule[',
($self->funnel_dataflow_rule_id ? ' --|| '.$self->funnel_dataflow_rule_id : ''), ($self->dbID // ''),
'): [#', ']: ',
$self->branch_code,
'] ',
$self->from_analysis->logic_name, $self->from_analysis->logic_name,
' -> ', ),
' --#',
$self->branch_code,
'--> ',
$self->to_analysis_url, $self->to_analysis_url,
($self->input_id_template ? (' WITH TEMPLATE: '.$self->input_id_template) : ''), ($self->input_id_template ? (' WITH TEMPLATE: '.$self->input_id_template) : ''),
($self->funnel_dataflow_rule ? ' ---|| ('.$self->funnel_dataflow_rule->toString(1).' )' : ''),
); );
} }
......
...@@ -60,7 +60,7 @@ sub name { ...@@ -60,7 +60,7 @@ sub name {
sub toString { sub toString {
my $self = shift @_; my $self = shift @_;
return ('ResourceClass: '.join(', ', map { $_.'="'.$self->$_().'"' } qw(dbID name) )); return 'ResourceClass['.($self->dbID // '').']: '.$self->name;
} }
1; 1;
......
...@@ -89,7 +89,7 @@ sub worker_cmd_args { ...@@ -89,7 +89,7 @@ sub worker_cmd_args {
sub toString { sub toString {
my $self = shift @_; my $self = shift @_;
return ('ResourceDescription: '.join(', ', map { $_.'="'.$self->$_().'"' } qw(resource_class_id meadow_type submission_cmd_args worker_cmd_args) )); return 'ResourceDescription: ('.$self->resource_class->name.', '.$self->meadow_type.')->("'.$self->submission_cmd_args.'", "'.$self->worker_cmd_args.'")';
} }
1; 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment