Robochameleon  v1.0
Functions
robolog.m File Reference

Robochameleon log utility. More...

Go to the source code of this file.

Functions

function robolog (in msg, in varargin)
 This function allows the user to print log messages in a standard way. More...
 

Detailed Description

Robochameleon log utility.

Log levels

Logging preferences

WARNING Preferences are persistent. Reset them at the beginning of any script, and set the relevant ones manually to avoid mistakes. After changing the preferences run clear all to make them effective.

Example

% Delete any previous log related settings
if ispref('roboLog')
rmpref('roboLog');
end
robolog('Info 1');
robolog('Info 2', 'NFO');
robolog('Warning 1', 'WRN');
robolog('Formatted %s %d', 'WRN', 'warning', 2);
% Enable logging to file only
setpref('roboLog', 'logToFile', 1);
robolog('Warning 3 to robolog.txt', 'WRN');
% Set log file
setpref('roboLog', 'logFile', 'myfile.txt');
robolog('Info 3 to myfile.txt', 'NFO');
robolog('ciao', 'ERR');
Author
Simone Gaiarin
Version
1

Definition in file robolog.m.

Function Documentation

function robolog ( in  msg,
in  varargin 
)

This function allows the user to print log messages in a standard way.

Parameters
msgThe message to be logged. Can be a printf-like format string.
varargin{1}Log type. Possible values: {'ERR', 'WRN', 'NFO'}. Default: 'NFO'.
varargin{2:end}Printf arguments.