forked from MartinVogel/ALPTool
-
Notifications
You must be signed in to change notification settings - Fork 2
/
logger.m
62 lines (53 loc) · 1.71 KB
/
logger.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
classdef (Abstract) logger < handle
% LOGGER Abstract base class for all LOGGERs
%
% class logger is the abstract base class for all
% logger classes in this package
%
% Methods:
% str = obj.log(str) logs data (abstract)
% level = obj.push() pushes logging level by one
% level = obj.pop() pop logging level by one
%
% Properties:
% obj.level the current logging level (read-only)
%
% File information:
% version 1.0 (feb 2014)
% (c) Martin Vogel
% email: [email protected]
%
% Revision history:
% 1.0 (feb 2014) initial release version
%
% See also:
% filelogger, textfilelogger, displogger
% +++++++++++++++++++++++++++++++++++++++++++++++++++++++
properties (SetAccess = public, GetAccess = public)
end
% +++++++++++++++++++++++++++++++++++++++++++++++++++++++
properties (SetAccess = protected, GetAccess = public)
level = 0;
end
% +++++++++++++++++++++++++++++++++++++++++++++++++++++++
properties (SetAccess = protected, GetAccess = protected)
end
% +++++++++++++++++++++++++++++++++++++++++++++++++++++++
methods (Abstract = true)
str = log(obj,str)
end
methods
function level = push(obj)
% push push logging level by one
obj.level = obj.level+1;
level = obj.level;
end
function level = pop(obj)
% pop pop logging level by one
if obj.level > 0
obj.level = obj.level-1;
end
level = obj.level;
end
end
end