Permalink
Browse files

add prefix to logs

  • Loading branch information...
1 parent ba336a6 commit 0fe1f61fbd0e42635d475a0ea925f54f32cf4ece matias alejo garcia committed Jan 10, 2013
Showing with 15 additions and 9 deletions.
  1. +7 −7 Makefile
  2. +8 −2 lib/SQL/Bibliosoph.pm
View
@@ -57,11 +57,11 @@ DIRFILESEP = /
DFSEP = $(DIRFILESEP)
NAME = SQL::Bibliosoph
NAME_SYM = SQL_Bibliosoph
-VERSION = 2.51
+VERSION = 2.52
VERSION_MACRO = VERSION
-VERSION_SYM = 2_51
+VERSION_SYM = 2_52
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
-XS_VERSION = 2.51
+XS_VERSION = 2.52
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
INST_ARCHLIB = blib/arch
@@ -273,7 +273,7 @@ RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
DIST_CP = best
DIST_DEFAULT = tardist
DISTNAME = SQL-Bibliosoph
-DISTVNAME = SQL-Bibliosoph-2.51
+DISTVNAME = SQL-Bibliosoph-2.52
# --- MakeMaker macro section:
@@ -534,7 +534,7 @@ metafile : create_distdir
$(NOECHO) $(ECHO) ' Tie::Hash::Random: 1' >> META_new.yml
$(NOECHO) $(ECHO) ' Time::HiRes: 1.97' >> META_new.yml
$(NOECHO) $(ECHO) ' perl: 5.010000' >> META_new.yml
- $(NOECHO) $(ECHO) 'version: 2.51' >> META_new.yml
+ $(NOECHO) $(ECHO) 'version: 2.52' >> META_new.yml
-$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
$(NOECHO) $(ECHO) Generating META.json
$(NOECHO) $(ECHO) '{' > META_new.json
@@ -590,7 +590,7 @@ metafile : create_distdir
$(NOECHO) $(ECHO) ' }' >> META_new.json
$(NOECHO) $(ECHO) ' },' >> META_new.json
$(NOECHO) $(ECHO) ' "release_status" : "stable",' >> META_new.json
- $(NOECHO) $(ECHO) ' "version" : "2.51"' >> META_new.json
+ $(NOECHO) $(ECHO) ' "version" : "2.52"' >> META_new.json
$(NOECHO) $(ECHO) '}' >> META_new.json
-$(NOECHO) $(MV) META_new.json $(DISTVNAME)/META.json
@@ -886,7 +886,7 @@ testdb_static :: testdb_dynamic
# --- MakeMaker ppd section:
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd :
- $(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="2.51">' > $(DISTNAME).ppd
+ $(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="2.52">' > $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ABSTRACT>A SQL Query library</ABSTRACT>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <AUTHOR>Matias Alejo Garcia ( matiu@cpan.org ) </AUTHOR>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> $(DISTNAME).ppd
View
@@ -9,7 +9,7 @@ package SQL::Bibliosoph; {
use SQL::Bibliosoph::Query;
use SQL::Bibliosoph::CatalogFile;
- our $VERSION = "2.51";
+ our $VERSION = "2.52";
has 'dbh' => ( is => 'ro', isa => 'DBI::db', required=> 1);
@@ -25,6 +25,7 @@ package SQL::Bibliosoph; {
has 'queries' => ( is => 'rw', default=> sub { return {}; } );
has 'memc' => ( is => 'rw');
+ has 'log_prefix'=> ( is => 'rw');
has throw_errors=> ( is => 'rw', default=> 1);
## OLD (just for backwards compat)
@@ -33,14 +34,19 @@ package SQL::Bibliosoph; {
sub d {
my $self = shift;
my $name = shift;
- print STDERR $name.join (':', map { $_ // 'NULL' } @_ ) if $self->debug();
+ print STDERR
+ $self->log_prefix()
+ . $name
+ . join (':', map { $_ // 'NULL' } @_ ) if $self->debug();
}
#------------------------------------------------------------------
sub BUILD {
my ($self) = @_;
+ $self->log_prefix('') if ! $self->log_prefix();
+
$self->d( "Constructing Bibliosoph\n" ) ;
$self->path( $self->path() . '/' ) if $self->path() ;

0 comments on commit 0fe1f61

Please sign in to comment.