sync with NSLog()

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@38594 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-05-31 10:12:04 +00:00
parent 442f5e8640
commit 6f0288bcd4
2 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2015-05-31 Richard Frith-Macdonald <rfm@gnu.org>
* EcLogger.m: When logging to stderr, use lock to synchronise with
logs produced by gnustep-base NSLog().
2015-05-29 Richard Frith-Macdonald <rfm@gnu.org>
* EcAlarmSinkSNMP.m: log SNMP errors via the main logging mechanism

View file

@ -234,7 +234,17 @@ static NSArray *modes;
{
buf = [str dataUsingEncoding: NSUTF8StringEncoding];
}
#if defined(GNUSTEP_BASE_LIBRARY)
{
NSRecursiveLock *l = GSLogLock();
[l lock];
fwrite([buf bytes], 1, [buf length], stderr);
[l unlock];
}
#else
fwrite([buf bytes], 1, [buf length], stderr);
#endif
if (LT_DEBUG != type)
{
if (nil == serverName)