Aerospike UDF日志消息的格式如下:
Mar 09 2016 23:32:18 GMT: DEBUG (udf): (udf_rw.c:send_udf_failure:183)
Non-special LDT or General UDF
Error(/opt/aerospike/usr/udf/lua/someFile.lua:33:
bad argument #1 to 'ipairs' (table expected, got nil))
关
问题是这些是错误类型的消息(它们破坏了功能),但是在DEBUG级别下记录。如果一个人正在记录INFO或WARN级别,理想情况下他们将能够看到"非特殊LDT或一般UDF错误"消息。
问题
是否可以配置"非特殊LDT或常规UDF错误"要在更高级别记录的消息,同时在DEBUG中保留其他真正的DEBUG级UDF消息(例如urecord ... dirty(1)
)?
答案 0 :(得分:1)
您只能按整个上下文设置日志级别,例如
NSArray *listObjects = .... (loading from Server) // List of PFObject
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
PFObject *object = [listObjects objectAtIndex:indexPath.row];
YourCell *cell = .....
if ([[object valueForKey:@"sandwichesOutofstock"] intValue] == 1)
cell.switch.on = true;
else
cell.switch.on = false;
cell.switch.tag = 500 + index.row;
[cell.switch addTarget:self action:@selector(switchTouch:) forControlEvents:UIControlEventTouchUpInside]
.........
}
(IBAction)switchTouch:(UISwitch *)switch{
long index = switch.tag - 500;
PFObject *object = [listObjects objectAtIndex:index];
if(switch.on)
[object setValue:@"1" ForKey:@"sandwichesOutofstock"];
else{
[object setValue:@"0" ForKey:@"sandwichesOutofstock"];
}
[object saveInBackground];
[self.tableView reloadRowsAtIndexPaths:[NSIndexPath indexPathForRow:index inSection:0] withRowAnimation:UITableViewRowAnimationNone];
}
使用logging {
file /var/log/aerospike.log {
context any info
context aggr critical
context udf critical
context query critical
}
file /var/log/lua.log {
context any critical
context aggr debug
context udf debug
context query debug
}
}
可以获得上下文列表。