From 7fee770c8d9acf54d813867f1cc2cf3da2f186f1 Mon Sep 17 00:00:00 2001 From: znek Date: Fri, 12 Nov 2004 16:24:02 +0000 Subject: [PATCH] new framework revision and addded missing headers git-svn-id: http://svn.opengroupware.org/SOPE/trunk@364 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- .../NGExtensions.xcode/project.pbxproj | 2 +- .../NGExtensions/NGExtensions/NGLogAppender.h | 46 +++++++++++++++ .../NGExtensions/NGLogConsoleAppender.h | 33 +++++++++++ .../NGExtensions/NGExtensions/NGLogEvent.h | 44 ++++++++++++++ .../NGExtensions/NGLogSyslogAppender.h | 38 ++++++++++++ .../NGExtensions/NGExtensions/NGLogger.h | 49 ++++++++++++++++ .../NGExtensions/NGLoggerManager.h | 40 +++++++++++++ .../NGExtensions/NGExtensions/NGLogging.h | 38 ++++++++++++ .../NGExtensions/NSObject+ExtendedLogging.h | 58 +++++++++++++++++++ 9 files changed, 347 insertions(+), 1 deletion(-) create mode 100644 sope-core/NGExtensions/NGExtensions/NGLogAppender.h create mode 100644 sope-core/NGExtensions/NGExtensions/NGLogConsoleAppender.h create mode 100644 sope-core/NGExtensions/NGExtensions/NGLogEvent.h create mode 100644 sope-core/NGExtensions/NGExtensions/NGLogSyslogAppender.h create mode 100644 sope-core/NGExtensions/NGExtensions/NGLogger.h create mode 100644 sope-core/NGExtensions/NGExtensions/NGLoggerManager.h create mode 100644 sope-core/NGExtensions/NGExtensions/NGLogging.h create mode 100644 sope-core/NGExtensions/NGExtensions/NSObject+ExtendedLogging.h diff --git a/sope-core/NGExtensions/NGExtensions.xcode/project.pbxproj b/sope-core/NGExtensions/NGExtensions.xcode/project.pbxproj index 518a70db..648ce6af 100644 --- a/sope-core/NGExtensions/NGExtensions.xcode/project.pbxproj +++ b/sope-core/NGExtensions/NGExtensions.xcode/project.pbxproj @@ -1650,7 +1650,7 @@ ); buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 4.5.126; + DYLIB_CURRENT_VERSION = 4.5.127; FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks"; FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/sope-core/NGExtensions/NGExtensions/NGLogAppender.h b/sope-core/NGExtensions/NGExtensions/NGLogAppender.h new file mode 100644 index 00000000..975a50c4 --- /dev/null +++ b/sope-core/NGExtensions/NGExtensions/NGLogAppender.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __NGExtensions_NGLogAppender_H_ +#define __NGExtensions_NGLogAppender_H_ + +/* + Abstract superclass for all appenders. +*/ + +#import +#include + +@class NGLogEvent; + +@interface NGLogAppender : NSObject +{ +} + +/* subclass responsibility */ +- (void)appendLogEvent:(NGLogEvent *)_event; +- (NSString *)formattedEvent:(NGLogEvent *)_event; + +- (NSString *)localizedNameOfLogLevel:(NGLogLevel)_level; + +@end + +#endif /* __NGExtensions_NGLogAppender_H_ */ diff --git a/sope-core/NGExtensions/NGExtensions/NGLogConsoleAppender.h b/sope-core/NGExtensions/NGExtensions/NGLogConsoleAppender.h new file mode 100644 index 00000000..90fc9b04 --- /dev/null +++ b/sope-core/NGExtensions/NGExtensions/NGLogConsoleAppender.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __NGExtensions_NGLogConsoleAppender_H_ +#define __NGExtensions_NGLogConsoleAppender_H_ + +#include + +@interface NGLogConsoleAppender : NGLogAppender +{ +} + +@end + +#endif /* __NGExtensions_NGLogConsoleAppender_H_ */ diff --git a/sope-core/NGExtensions/NGExtensions/NGLogEvent.h b/sope-core/NGExtensions/NGExtensions/NGLogEvent.h new file mode 100644 index 00000000..8d541bc8 --- /dev/null +++ b/sope-core/NGExtensions/NGExtensions/NGLogEvent.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __NGExtensions_NGLogEvent_H_ +#define __NGExtensions_NGLogEvent_H_ + +#import +#include + + +@interface NGLogEvent : NSObject +{ + NSString *msg; + NGLogLevel level; + NSTimeInterval date; +} + +- (id)initWithLevel:(NGLogLevel)_level message:(NSString *)_msg; + +- (NGLogLevel)level; +- (NSString *)message; +- (NSDate *)date; + +@end + +#endif /* __NGExtensions_NGLogEvent_H_ */ diff --git a/sope-core/NGExtensions/NGExtensions/NGLogSyslogAppender.h b/sope-core/NGExtensions/NGExtensions/NGLogSyslogAppender.h new file mode 100644 index 00000000..4e3b99f7 --- /dev/null +++ b/sope-core/NGExtensions/NGExtensions/NGLogSyslogAppender.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __NGExtensions_NGLogSyslogAppender_H_ +#define __NGExtensions_NGLogSyslogAppender_H_ + +#include + +@interface NGLogSyslogAppender : NGLogAppender +{ +} + ++ (id)sharedAppender; + +/* provide syslog identifier */ +- (id)initWithIdentifier:(NSString *)_ident; + +@end + +#endif /* __NGExtensions_NGLogSyslogAppender_H_ */ diff --git a/sope-core/NGExtensions/NGExtensions/NGLogger.h b/sope-core/NGExtensions/NGExtensions/NGLogger.h new file mode 100644 index 00000000..1e9ddfcc --- /dev/null +++ b/sope-core/NGExtensions/NGExtensions/NGLogger.h @@ -0,0 +1,49 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __NGExtensions_NGLogger_H_ +#define __NGExtensions_NGLogger_H_ + +/* + The logger, modeled closely after log4j. + */ + +#import +#include + + +@interface NGLogger : NSObject +{ + NGLogLevel logLevel; + id _appender; // going away as soon as we have a config +} + +- (id)initWithLogLevel:(NGLogLevel)_level; + +- (void)logLevel:(NGLogLevel)_level message:(NSString *)_msg; +- (void)logLevel:(NGLogLevel)_level withFormat:(NSString *)_fmt, ...; + +- (void)setLogLevel:(NGLogLevel)_level; +- (NGLogLevel)logLevel; + +@end + +#endif /* __NGExtensions_NGLogger_H_ */ diff --git a/sope-core/NGExtensions/NGExtensions/NGLoggerManager.h b/sope-core/NGExtensions/NGExtensions/NGLoggerManager.h new file mode 100644 index 00000000..26214f5c --- /dev/null +++ b/sope-core/NGExtensions/NGExtensions/NGLoggerManager.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __NGExtensions_NGLoggerManager_H_ +#define __NGExtensions_NGLoggerManager_H_ + +#import + +@class NGLogger; + +@interface NGLoggerManager : NSObject +{ + NSMutableDictionary *loggerMap; +} + ++ (id)defaultManager; + +- (NGLogger *)loggerForDefaultKey:(NSString *)_defaultKey; + +@end + +#endif /* __NGExtensions_NGLoggerManager_H_ */ diff --git a/sope-core/NGExtensions/NGExtensions/NGLogging.h b/sope-core/NGExtensions/NGExtensions/NGLogging.h new file mode 100644 index 00000000..b4d0b4b8 --- /dev/null +++ b/sope-core/NGExtensions/NGExtensions/NGLogging.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __NGExtensions_NGLogging_H_ +#define __NGExtensions_NGLogging_H_ + +/* + NGLogging is a somewhat more sophisticated logging framework, modeled + apparently similar to log4j - without some of its bloat. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#endif /* __NGExtensions_NGLogging_H_ */ diff --git a/sope-core/NGExtensions/NGExtensions/NSObject+ExtendedLogging.h b/sope-core/NGExtensions/NGExtensions/NSObject+ExtendedLogging.h new file mode 100644 index 00000000..15524414 --- /dev/null +++ b/sope-core/NGExtensions/NGExtensions/NSObject+ExtendedLogging.h @@ -0,0 +1,58 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __NSObject_ExtendedLogging_H_ +#define __NSObject_ExtendedLogging_H_ + +#import + +typedef enum { + NGLogLevelOff = 0, + NGLogLevelDebug = 1, + NGLogLevelInfo = 2, + NGLogLevelWarn = 3, + NGLogLevelError = 4, + NGLogLevelFatal = 5, + NGLogLevelAll = 6 +} NGLogLevel; + +@interface NSObject (NGExtendedLogging) + +- (id)logger; + +- (void)logDebugWithFormat:(NSString *)_fmt, ...; +- (void)logInfoWithFormat:(NSString *)_fmt, ...; +- (void)logWarnWithFormat:(NSString *)_fmt, ...; +- (void)logErrorWithFormat:(NSString *)_fmt, ...; +- (void)logFatalWithFormat:(NSString *)_fmt, ...; + +- (BOOL)isLogDebugEnabled; +- (BOOL)isLogInfoEnabled; +- (BOOL)isLogWarnEnabled; +- (BOOL)isLogErrorEnabled; +- (BOOL)isLogFatalEnabled; + +- (void)logLevel:(NGLogLevel)_level message:(NSString *)_msg; +- (void)logLevel:(NGLogLevel)_level withFormat:(NSString *)_fmt, ...; + +@end + +#endif /* __NSObject_ExtendedLogging_H_ */ -- 2.39.5