Chris@7: /** Chris@7: * Some logging facilities Chris@7: * Copyright Yves Raimond (c) 2006 Chris@7: */ Chris@7: :- module(log,[log/1,log/2]). Chris@7: Chris@7: Chris@8: log_file('peel-uri.log'). Chris@7: Chris@7: log(MessageFormat,Vars) :- Chris@7: sformat(String,MessageFormat,Vars), Chris@7: log(String). Chris@7: Chris@7: log(Message) :- Chris@7: get_time(A), Chris@7: convert_time(A,Y,M,D,H,Min,S,_), Chris@7: sformat(Stamp,'<~d/~d/~d-~d:~d:~d> ',[Y,M,D,H,Min,S]), Chris@7: log_file(File), Chris@7: open(File,append,Stream,[]), Chris@7: write(Stream,Stamp), Chris@7: write(Stream,Message), Chris@7: write(Stream,'\n'), Chris@7: close(Stream). Chris@7: Chris@7: