log4m - A powerful and simple logger for matlab

버전 1.0.0.0 (3 KB) 작성자: Luke Winslow
A simple logger with log4j functionality but designed with the matlab-user in mind.
다운로드 수: 2.9K
업데이트 날짜: 2012/8/2

라이선스 보기

Description: Log4m is designed to be relatively fast and very easy to use. It has been designed to work well in a matlab environment.

log4m uses the same level system as log4j {'ALL','TRACE','DEBUG','INFO','WARN','ERROR','FATAL','OFF'} and is an attempt to create a single-file, robust drop-in system for more advanced logging. It only provides a single logger object within an entire matlab instance, so you don't need to track a file or object reference.

I currently use this in long-running compiled jobs so I can track how they are performing without manual intervention or observation.

--

Example:
%To create the logger reference:
L = log4m.getLogger('logfile.txt');

% To log an error event
L.error('exampleFunction','An error occurred');

% To log a trace event
L.trace('function','Trace this event');

--

If you want to display all logging information to the command prompt while only writing major events worse than an error to the log file, you can set the desired log levels accordingly.

L.setCommandWindowLevel(L.ALL);
L.setLogLevel(L.ERROR);

%Now all messages will be displayed to the command prompt while only error and fatal messages will be logged to file.

-----
Note: This project is similar to the log4matlab code acknowledged, but is easier to use and has an API more in the 'matlab style'.

인용 양식

Luke Winslow (2024). log4m - A powerful and simple logger for matlab (https://www.mathworks.com/matlabcentral/fileexchange/37701-log4m-a-powerful-and-simple-logger-for-matlab), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2011a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Entering Commands에 대해 자세히 알아보기
태그 태그 추가

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0