+2004-05-27 Marcus Mueller <mm@skyrix.com>
+
+ * README, NOTES: updated
+
+ * NGExtensions/NGLogging/ChangeLog: created
+
2004-05-26 Marcus Mueller <mm@skyrix.com>
* ChangeLog: created
--- /dev/null
+2004-05-27 Marcus Mueller <mm@skyrix.com>
+
+ * NGLogSyslogAppender.[hm]: syslog appender, untested.
+
+ * ChangeLog: created
--- /dev/null
+/*
+ Copyright (C) 2000-2004 SKYRIX Software AG
+
+ This file is part of OGo
+
+ 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.
+*/
+// $Id$
+
+
+#ifndef __NGLogSyslogAppender_H_
+#define __NGLogSyslogAppender_H_
+
+
+#import "NGLogAppender.h"
+
+
+@interface NGLogSyslogAppender : NGLogAppender
+{
+
+}
+
++ (id)sharedAppender;
+
+/* provide syslog identifier */
+- (id)initWithIdentifier:(NSString *)_ident;
+
+@end
+
+#endif /* __NGLogSyslogAppender_H_ */
--- /dev/null
+/*
+ Copyright (C) 2000-2004 SKYRIX Software AG
+
+ This file is part of OGo
+
+ 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.
+*/
+// $Id$
+
+
+#import "NGLogSyslogAppender.h"
+#import "NGLogEvent.h"
+#include <syslog.h>
+#include <stdarg.h>
+
+
+@interface NGLogSyslogAppender (PrivateAPI)
+- (int)syslogPriorityForLogLevel:(NGLogLevel)_level;
+@end
+
+@implementation NGLogSyslogAppender
+
+
+static NSString *defaultSyslogIdentifier = nil;
+
+
++ (void)initialize {
+ NSUserDefaults *ud;
+ static BOOL isInitialized = NO;
+
+ if(isInitialized)
+ return;
+
+ ud = [NSUserDefaults standardUserDefaults];
+ defaultSyslogIdentifier =
+ [[ud stringForKey:@"NGLogSyslogIdentifier"] retain];
+
+ isInitialized = YES;
+}
+
++ (id)sharedAppender {
+ static id sharedAppender = nil;
+ if(sharedAppender == nil) {
+ sharedAppender = [[self alloc] init];
+ }
+ return sharedAppender;
+}
+
+- (id)init {
+ return [self initWithIdentifier:defaultSyslogIdentifier];
+}
+
+- (id)initWithIdentifier:(NSString *)_ident {
+ if((self = [super init])) {
+ #warning ** default flags?
+ openlog([_ident cString], LOG_PID | LOG_NDELAY, LOG_USER);
+ }
+ return self;
+}
+
+- (void)dealloc {
+ closelog();
+ [super dealloc];
+}
+
+- (void)appendLogEvent:(NGLogEvent *)_event {
+ int level;
+
+ level = [self syslogPriorityForLogLevel:[_event level]];
+ syslog(level, [[_event message] cString]);
+}
+
+- (int)syslogLevelForLogLevel:(NGLogLevel)_level {
+ int level;
+
+ switch (_level) {
+ case NGLogLevelDebug:
+ level = LOG_DEBUG;
+ break;
+ case NGLogLevelInfo:
+ level = LOG_INFO;
+ break;
+ case NGLogLevelWarn:
+ level = LOG_WARNING;
+ break;
+ case NGLogLevelError:
+ level = LOG_ERR;
+ break;
+ case NGLogLevelFatal:
+ level = LOG_ALERT; // LOG_EMERG is broadcast to all users...
+ break;
+ default:
+ level = LOG_NOTICE;
+ break;
+ }
+ return level;
+}
+
+@end
+$Id$
+
+- NGExtensions
+ - Stuff I believe might be useful for later addition to NGExtensions framework
+
+ - NGLogging
+ - Had a look at log4cocoa, appeared to be too bloated (they mimic all of
+ log4j which doesn't really make sense in Objective-C).
+ - NGLogConsoleAppender is the only appender currently available, it's
+ hardcoded in NGLogger as default. This should change as soon as we have
+ a config for that purpose. Logging is low priority, so we don't need to
+ do that too soon.
+ - Syslog appender might be useful for the ministry. Syslog provides its own
+ buffering, so syslog appender should be straight forward.
\ No newline at end of file
$Id$
+WebUI
+ Part of SOGo
+ Copyright (C) 2000-2004 SKYRIX Software AG - http://www.skyrix.com/
-Xcode notes:
+Subprojects
+===========
+
+- NGExtensions
+ - NGLogging
+
+
+UserDefaults
============
+ Default | Type | Example Value
+ =============================================================
+ NGLogSyslogIdentifier | String | WebUI
+
+
-Rapid Development
-=================
-In order for "Rapid Development" to work properly you need to open
-Xcode's "Project" menu and select "Edit active executable"
-(Apple-Option-X). In the following dialog navigate to the "Runtime"
-section and select the "Project Directory" as the working directory
-when launching the executable.
ADC15A4F0664E25B0063754B,
ADC15A560664E33A0063754B,
AD1967250665E52400E19038,
+ AD0618D0066610A200AC467F,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
ADA38B8205DD238A00C820AA,
AD95AEBA0664BC6700FCB211,
AD95AEBC0664BC7B00FCB211,
+ AD0618D50666121C00AC467F,
);
isa = PBXResourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
ADC15A500664E25B0063754B,
ADC15A570664E33A0063754B,
AD1967260665E52400E19038,
+ AD0618D1066610A200AC467F,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
//AD2
//AD3
//AD4
+ AD0618CE066610A200AC467F = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ path = NGLogSyslogAppender.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ AD0618CF066610A200AC467F = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.objc;
+ path = NGLogSyslogAppender.m;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ AD0618D0066610A200AC467F = {
+ fileRef = AD0618CE066610A200AC467F;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ AD0618D1066610A200AC467F = {
+ fileRef = AD0618CF066610A200AC467F;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ AD0618D40666121C00AC467F = {
+ explicitFileType = text;
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = ChangeLog;
+ refType = 4;
+ sourceTree = "<group>";
+ tabWidth = 4;
+ usesTabs = 1;
+ };
+ AD0618D50666121C00AC467F = {
+ fileRef = AD0618D40666121C00AC467F;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
AD0ACCDE062732BD0054A820 = {
children = (
AD0ACCDF062733370054A820,
path = ChangeLog;
refType = 4;
sourceTree = "<group>";
+ tabWidth = 4;
usesTabs = 1;
};
AD95AEBC0664BC7B00FCB211 = {
ADC15A530664E3280063754B = {
children = (
AD1967660665FE6800E19038,
+ AD0618D40666121C00AC467F,
ADC15A450664DA320063754B,
ADC15A410664D1D90063754B,
ADC15A420664D1D90063754B,
ADC15A4E0664E25B0063754B,
AD1967230665E52400E19038,
AD1967240665E52400E19038,
+ AD0618CE066610A200AC467F,
+ AD0618CF066610A200AC467F,
);
isa = PBXGroup;
name = Logging;