-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
- Remove
+verb/submodule, in favour of using thedk.logger.Loggerimplementation. - Default logger should be created at startup.
- Additional function
dk.logger.levelto simplify level control. - Alias method
Logger:setFile, more explicit thanopen. - Implement static class
dk.logger.testto be called byassert/rejectin order to redirect assertions to different channels. - Remove static method
callerInfofromLogger, and move it to separatedk.logger.chaninstead (taking stack depth argument), which returns a struct with channel ID and caller string. - Update
Logger:writeto take a channel as first input, and exclude empty caller from log line. - Implement function
dk.log, taking a channel as first input (or creating a default one if formatted message is passed directly), with a persistent instance of the default logger.
funciton log(varargin)
persistent..
args = varargin;
if nargin > 1
v = args{1};
if isstruct(v)
chan = v;
args = varargin(2:end);
elseif ismember(v,{'w','e','...'})
chan = dk.logger.chan( v, 4 );
args = varargin(2:end);
else
chan = dk.logger.chan( 'i', 4 );
end
end
L.write( chan, args{:} );
end- Refactor functions
dk.warn/infoto calldk.log - Remove
..ifmethods fromLogger, in favour of directed assertions. - Replace calls to
dk.wassert/wrejectwith calls toassertwith specified channels.