图像缩略图

消息记录器

version 1.0.3 (247 KB) by 何塞·德尔里约(Jose del Rio)
Message logger with font formats, timestamp, auto save, verbose, graphical interface, inheritance...

71个下载

Updated2017年3月12日

查看许可证

消息记录器对象可以自动存储或不使用格式和时间戳的消息。
对象(MCV):
- logModel
-logController
- logView

LogModel:存储所有消息及其属性(颜色,大小,样式等)。
logController:模型和视图之间的接口。使用它来创建图形接口。
logView:图形用户界面在可滚动列表框中显示带有其属性的消息。

As for the standard MCV architecture the model can be used with or without the view. Normal use:
mainlog = logger.logmodel%创建日志
logcont = logger.logcontroller(mainlog)%为开发的记录器创建GUI

LogModel的功能包括:
- Font formatting independent for each line. The text will show the selected formatting when using the view gui or when exporting to HTML. Valid formats include color, size, font types ('Arial', 'Comic Sans MS', 'Courier', 'Impact', 'Times New Roman', 'Verdana') and styles ('Bold', 'Italic', 'mark', 'emphasized', 'subscript', 'superscript'). A list of pre-defined colors is available by typing 'logger.getcolorlist'.
- Automatic saving of the logs into a file (txt or HTML). An output file can be defined at any moment and all new messages will be stored in the file. Until this option is disabled again (by defining an empty string) the output file shouldn't be open by any software that locks the access to the file, like MS Office or any new message won't be stored in the file.
- 自动生成的时间戳将在形式的消息上应用。默认情况下,此属性已启用。
——能力assingning“防御”的水平message from 1 to 6. Usually 1 being an error, 2 a warning and 3 to 6 user defined levels. By default level 1 will be asigned color red and level 2 will be asigned orange unless the user specifies a different colorSet.
- 将日志导出到:剪贴板,TXT文件或HTML文件。
- 过滤每个时间戳,属性,文本或DEFCON级别的日志。
- 记录对象之间的继承。可以创建多个对象来跟踪不同的消息并定义将从其他日志记录器接收所有消息的主要或父logger。每个对象都会保留跟踪或自己的消息。可以将视图分配给每个记录仪或主登录器。
- 详细模式。自动将任何新消息打印到命令行。默认设置为false。

该工具箱由Jose del Rio开发

感谢此软件包中使用的外部库的开发人员(请参阅许可证):
- colornames by Stephen Cobeldick. Used by the model. It's optional but it is nicer to have a list of colors instead of RGB numbers.
- GUI Layout Toolbox by David Sampson. Used in the view.
- findobj tool by Yair Altman. Used in the view.

Examples:

使用默认值创建的%记录器
mainLog = logger.logModel

具有某些参数的%记录器(带有时间戳的日志行,自动保存日志到文件中,详细到命令行...)
mainlog = logger.logmodel('default_defcon',3,'flag_timestamp',false,'log_file','2017-03-11_log.txt','verbose',true)

%创建辅助日志
secondary_log1 = logger.logmodel
secondary_log2 = logger.logmodel

% Link all messages of the secondary_logs to the main logger
mainlog.addchild(Secondary_log1)
mainlog.Addchild(sindary_log2)

%从任何记录仪中随时创建一些视图
ViewMain = Logger.logcontroller(Mainlog)
viewSec1 = logger.logController(secondary_log1)
...

% Add new entries...
mainLog.newEntry('Hello') % Entry with default properties: 2017-03-05 10:32:48 >> Hello
mainlog.newentry('这是一个错误','defcon',1%的颜色条目定义为1级
mainLog.newEntry('This is other error', 'defcon', 1, 'prop', 'yellow') % Entry of level 1 with overwritten color property

具有多行和多个属性的输入(“ BOLD”,“斜体”,“ Mark”,“强调”,“下标”,“ SupperScript”,“ SuperScript”将在HTML文件中正确显示)
MULTILINE = SPRINTF('多行\ nin单条目')
mainlog.newentry(Multiline,'Prop',{'light Blue',3,'Bold','Comic sans ms'})

% To store some value
mainLog.newParam(myvalue, 'name', 'version')
请随时发送任何建议

引用为

Jose Del Rio(2022)。消息记录器(//www.tatmou.com/matlabcentral/fileexchange/61999-message-logger),matlab中央文件交换。检索

MATLABRelease Compatibility
Created with R2016a
Compatible with any release
平台兼容性
Windows macOS Linux

社区寻宝

在Matlab Central中找到宝藏,发现社区如何为您提供帮助!

Start Hunting!