anchor.diff:  %%% Author  : Magnus Ahltorp <ahltorp@nada.kth.se>
   %%% Descrip.: Logger is the process that writes our log messages
   %%%           to disk (and erlang shell).
  +%%%
   %%% Created : 15 Nov 2002 by Magnus Ahltorp <ahltorp@nada.kth.se>
   %%%
  -%%% Note: binary data is much faster to write to disk (~ x100 times)
  -%%%       and may be preferable if this module is used with higher 
  -%%%       loads. 
   %%% Note: with the current implementation - the logger being 
   %%%       registered as 'logger' there can be only one logger per 
   %%%       node. Running the same application on several nodes both 
   %%%       wich have the same file:get_cwd/0 will result in both 
   %%%       using the same log files UNLESS they have a different
   %%%       configured logger_logbasename.
  -%%% Note: erlang/OTP has it's own log module - disk_log, that among 
  -%%%       other things is able to do log rotation
  +%%% Note: Erlang/OTP has it's own log module - disk_log, that among 
  +%%%       other things is able to do log rotation. People having used
  +%%%       it is not all happy though.
   %%% 
   %%%-------------------------------------------------------------------
   -module(logger).
  
positive.code: %% Descrip.: log a log entry
  %% Returns : ok
  %%--------------------------------------------------------------------
  log(Level, Format) when atom(Level), list(Format) ->
      log(Level, Format, []).
  
  log(Level, Format, Arguments) when atom(Level), list(Format), list(Arguments) ->
      do_log(Level, Format, Arguments).
  
  %%--------------------------------------------------------------------
  
negative.code: 	    ok;
  	Size ->
  	    %% Set up a timer to do the size checking every 60 seconds
  	    {ok, _T} = timer:send_interval(60 * 1000, logger, {check_logfile_size, Size})
      end,
      %% Construct log filenames and open/create them
      DebugFn = lists:concat([Basename, ".debug"]),
      NormalFn = lists:concat([Basename, ".log"]),
      ErrorFn = lists:concat([Basename, ".error"]),
      {ok, DebugIoDevice} = safe_open(DebugFn, ?FILE_OPTS),
      {ok, NormalIoDevice} = safe_open(NormalFn, ?FILE_OPTS),
      {ok, ErrorIoDevice} = safe_open(ErrorFn, ?FILE_OPTS),
      {ok, #state{debug_iodev=DebugIoDevice, debug_fn=DebugFn,
  		normal_iodev=NormalIoDevice, normal_fn=NormalFn,
  		error_iodev=ErrorIoDevice, error_fn=ErrorFn}}.
  