Skip to content

Instantly share code, notes, and snippets.

@jreyes1108
Created August 2, 2010 22:35
Show Gist options
  • Save jreyes1108/505447 to your computer and use it in GitHub Desktop.
Save jreyes1108/505447 to your computer and use it in GitHub Desktop.
: # use perl
eval 'exec $ANTELOPE/bin/perl -S $0 "$@"'
if 0;
#
# Script to test elog fucntions
# in Antelope's Perl interface to Datascope.
# Juan C. Reyes
# [email protected]
#
use lib "$ENV{ANTELOPE}/data/perl" ;
use Datascope;
print "\n$0 - Script to test elog fucntions in Perl.\n\n";
#
# Print to STDOUT
#
#$ENV{'ELOG_DELIVER'} = "stdout";
#
# Print to file and/or STDOUT
#
$tmp = './temp_log';
unlink($tmp) if -e $tmp;
#$ENV{'ELOG_DELIVER'} = "$tmp";
#$ENV{'ELOG_DELIVER'} = "$tmp stdout";
elog_init($0,@ARGV);
#
# TEST elog functions
#
elog_log '';
elog_log "Test elog_log simple";
elog_notify "Test elog_notify ...";
elog_complain "Test elog_complain ...";
elog_alert "Test elog_alert ...";
elog_debug "Test elog_debug ...";
for ( my $t = 0 ; $t < 11 ; $t++ ) {
elog_log "$t) elog_log looped";
}
#
# TEST elog message log
#
elog_log '';
elog_log "elog_mark: ".elog_mark();
elog_log '';
elog_log "elog_sting: \n".elog_string(0);
elog_log '';
#elog_log "elog_flush: \n".elog_flush(0,0);
elog_log "elog_flush: \n".elog_flush(1,0);
elog_log '';
elog_log "elog_mark: ".elog_mark();
#
# ENV values for ELOG
#
elog_log '';
elog_log "ENV values for elog:";
elog_log "\tELOG_TAG= ".$ENV{'ELOG_TAG'};
elog_log "\tELOG_DEBUG= ".$ENV{'ELOG_DEBUG'};
elog_log "\tELOG_MAXMSG= ".$ENV{'ELOG_MAXMSG'};
elog_log "\tELOG_SIGNALS= ".$ENV{'ELOG_SIGNALS'};
elog_log "\tELOG_DELIVER= ".$ENV{'ELOG_DELIVER'};
#
# TEST PF values for elog.pf
#
elog_log '';
elog_log "PF file for elog:";
elog_log "\tpf{elog.pf}{ELOG_MAXMSG}: ".pfget('elog.pf','ELOG_MAXMSG');
elog_log "\tpf{elog.pf}{ELOG_DELIVER}{log}: ".pfget('elog.pf','ELOG_DELIVER{log}');
elog_log "\tpf{elog.pf}{ELOG_DELIVER}{notify}: ".pfget('elog.pf','ELOG_DELIVER{notify}');
elog_log "\tpf{elog.pf}{ELOG_DELIVER}{alert}: ".pfget('elog.pf','ELOG_DELIVER{alert}');
elog_log "\tpf{elog.pf}{ELOG_DELIVER}{debug}: ".pfget('elog.pf','ELOG_DELIVER{debug}');
elog_die "Test elog_die ... \n\nDONE!";
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment