| 1 | #!/usr/bin/perl -w | ||
| 2 | # | ||
| 3 | # Log.pm | ||
| 4 | # | ||
| 5 | # $Revision: 1.2 $ | ||
| 6 | # | ||
| 7 | # TODO: | ||
| 8 | # | ||
| 9 | # * gda_log_clean_between() and gda_log_clean_entry are in the API docs, but | ||
| 10 | # are not found when running strings on the libgda-common.a file. Therefore | ||
| 11 | # they are not included here. | ||
| 12 | # | ||
| 13 | # Copyright (C) 2001 Gregor N. Purdy. All rights reserved. | ||
| 14 | # | ||
| 15 | # This program is free software. It may be modified and/or | ||
| 16 | # distributed under the same terms as Perl itself. | ||
| 17 | # | ||
| 18 | |||
| 19 | use strict; | ||
| 20 | |||
| 21 | package GDA::Log; | ||
| 22 | |||
| 23 | use GDA; | ||
| 24 | |||
| 25 | use Inline 'C'; | ||
| 26 | |||
| 27 | use Inline 'C' => Config => | ||
| 28 | INC => '-I/usr/include/gda -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/include/gtk-1.2 -I/usr/include/gnome-xml', | ||
| 29 | AUTO_INCLUDE => '#include "gda-config.h"', | ||
| 30 | LIBS => '-lgda-common'; | ||
| 31 | |||
| 32 | sub message | ||
| 33 | { | ||
| 34 | my $message = sprintf(@_); | ||
| 35 | |||
| 36 | $message =~ s/\\/\\\\/; # Double any backslashes | ||
| 37 | $message =~ s/%/\\%/; # Escape any fields | ||
| 38 | |||
| 39 | message_impl($message); | ||
| 40 | } | ||
| 41 | |||
| 42 | sub error | ||
| 43 | { | ||
| 44 | my $message = sprintf(@_); | ||
| 45 | |||
| 46 | $message =~ s/\\/\\\\/; # Double any backslashes | ||
| 47 | $message =~ s/%/\\%/; # Escape any fields | ||
| 48 | |||
| 49 | error_impl($message); | ||
| 50 | } | ||
| 51 | |||
| 52 | 1; | ||
| 53 | |||
| 54 | =head1 NAME | ||
| 55 | |||
| 56 | GDA::Log - GDA logging Perl bindings | ||
| 57 | |||
| 58 | =head1 SYNOPSIS | ||
| 59 | |||
| 60 | use GDA 'my_app', 'my_ver', 'my_prog'; | ||
| 61 | use GDA::Log; | ||
| 62 | ... | ||
| 63 | |||
| 64 | =head1 DESCRIPTION | ||
| 65 | |||
| 66 | TODO | ||
| 67 | |||
| 68 | =head1 AUTHOR | ||
| 69 | |||
| 70 | Gregor N. Purdy E<lt>gregor@focusresearch.comE<gt> | ||
| 71 | |||
| 72 | =head1 LICENSE | ||
| 73 | |||
| 74 | This program is free software. It may be modified and/or | ||
| 75 | distributed under the same terms as Perl itself. | ||
| 76 | |||
| 77 | =head1 COPYRIGHT | ||
| 78 | |||
| 79 | Copyright (C) 2001 Gregor N. Purdy. All rights reserved. | ||
| 80 | |||
| 81 | =cut | ||
| 82 | |||
| 83 | __DATA__ |