From 2d5bf214784b763983de2dbb3bd8d8a58ba27eab Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Wed, 15 Jul 2020 15:06:23 +0100 Subject: [PATCH] Add more informative -description --- EcAlarmDestination.m | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/EcAlarmDestination.m b/EcAlarmDestination.m index 2f32def..fac1239 100644 --- a/EcAlarmDestination.m +++ b/EcAlarmDestination.m @@ -206,6 +206,29 @@ [super dealloc]; } +- (NSString*) description +{ + NSString *desc; + + [_alarmLock lock]; + if (_isRunning) + { + desc = [NSString stringWithFormat: @"%@ host:%@ name:%@" + @" queue:%u active:%u cleared:%u managed:%u", + [super description], _host, _name, (unsigned)[_alarmQueue count], + (unsigned)[_alarmsActive count], + (unsigned)[_alarmsCleared count], + (unsigned)[_managedObjects count]]; + } + else + { + desc = [NSString stringWithFormat: @"%@ host:%@ name:%@ Not Running", + [super description], _host, _name]; + } + [_alarmLock unlock]; + return desc; +} + - (id) initWithHost: (NSString*)host name: (NSString*)name { if (nil != (self = [super init]))