ObjFW  Check-in [f3bfba9d06]

Overview
Comment:Show milliseconds in of_log output.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f3bfba9d065dd74ed30b16ef7d2724000e207c2a7b1bd268b9ae9b5e1752996e
User & Date: js on 2011-02-01 22:18:18
Other Links: manifest | tags
Context
2011-02-01
22:30
Add support for ObjC++ to objfw-compile.
It assumes the ObjC compiler is also capable to compile ObjC++.
check-in: 55843dd643 user: js tags: trunk
22:18
Show milliseconds in of_log output. check-in: f3bfba9d06 user: js tags: trunk
22:11
Use extern "C" where useful.
Improves ObjC++ compatibility.
check-in: 03d1b71d10 user: js tags: trunk
Changes

Modified src/OFFile.m from [00f92e27f7] to [719e5e7862].

105
106
107
108
109
110
111

112

113
114

115

116
117
118
119
120
121
122
123


124
125
126
127
128
129
130
105
106
107
108
109
110
111
112

113
114
115
116

117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
132
133







+
-
+


+
-
+







-
+
+







	return -1;
}

void
of_log(OFConstantString *fmt, ...)
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFDate *date;
	OFString *date, *me, *msg;
	OFString *date_str, *me, *msg;
	va_list args;

	date = [OFDate date];
	date = [[OFDate date] localDateStringWithFormat: @"%Y-%m-%dT%H:%M:%S"];
	date_str = [date localDateStringWithFormat: @"%Y-%m-%d %H:%M:%S"];
	me = [OFFile lastComponentOfPath: [OFApplication programName]];

	va_start(args, fmt);
	msg = [[[OFString alloc] initWithFormat: fmt
				      arguments: args] autorelease];
	va_end(args);

	[of_stderr writeFormat: @"[%@ %@(%d)] %@\n", date, me, getpid(), msg];
	[of_stderr writeFormat: @"[%@.%03d %@(%d)] %@\n", date_str,
				[date microsecond] / 1000, me, getpid(), msg];

	[pool release];
}

@interface OFFileSingleton: OFFile
@end