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