Skip to content

Commit

Permalink
LibComponentLogging-SystemLog-1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aharren committed Aug 26, 2012
2 parents 03df860 + b80e553 commit 53d42d9
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 15 deletions.
37 changes: 26 additions & 11 deletions LCLSystemLog.h
Expand Up @@ -3,7 +3,7 @@
// LCLSystemLog.h // LCLSystemLog.h
// //
// //
// Copyright (c) 2008-2011 Arne Harren <ah@0xc0.de> // Copyright (c) 2008-2012 Arne Harren <ah@0xc0.de>
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal // of this software and associated documentation files (the "Software"), to deal
Expand All @@ -24,8 +24,8 @@
// THE SOFTWARE. // THE SOFTWARE.


#define _LCLSYSTEMLOG_VERSION_MAJOR 1 #define _LCLSYSTEMLOG_VERSION_MAJOR 1
#define _LCLSYSTEMLOG_VERSION_MINOR 1 #define _LCLSYSTEMLOG_VERSION_MINOR 2
#define _LCLSYSTEMLOG_VERSION_BUILD 4 #define _LCLSYSTEMLOG_VERSION_BUILD 1
#define _LCLSYSTEMLOG_VERSION_SUFFIX "" #define _LCLSYSTEMLOG_VERSION_SUFFIX ""




Expand Down Expand Up @@ -201,17 +201,26 @@
# endif # endif
#endif #endif
#if _lcl_logger_autoreleasepool_arc #if _lcl_logger_autoreleasepool_arc
#define _lcl_logger_autoreleasepool_begin \ # define _lcl_logger_autoreleasepool_begin \
@autoreleasepool { @autoreleasepool {
#define _lcl_logger_autoreleasepool_end \ # define _lcl_logger_autoreleasepool_end \
} }
#else #else
#define _lcl_logger_autoreleasepool_begin \ # define _lcl_logger_autoreleasepool_begin \
NSAutoreleasePool *_lcl_logger_autoreleasepool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *_lcl_logger_autoreleasepool = [[NSAutoreleasePool alloc] init];
#define _lcl_logger_autoreleasepool_end \ # define _lcl_logger_autoreleasepool_end \
[_lcl_logger_autoreleasepool release]; [_lcl_logger_autoreleasepool release];
#endif #endif


#ifndef _LCL_NO_IGNORE_WARNINGS
# ifdef __clang__
// Ignore some warnings about variadic macros when using '-Weverything'.
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wunknown-pragmas"
# pragma clang diagnostic ignored "-Wvariadic-macros"
# pragma clang diagnostic ignored "-Wpedantic"
# endif
#endif


// Define the _lcl_logger macro which integrates LCLSystemLog as a logging // Define the _lcl_logger macro which integrates LCLSystemLog as a logging
// back-end for LibComponentLogging and pass the header of a log component as // back-end for LibComponentLogging and pass the header of a log component as
Expand All @@ -228,3 +237,9 @@
_lcl_logger_autoreleasepool_end \ _lcl_logger_autoreleasepool_end \
} }


#ifndef _LCL_NO_IGNORE_WARNINGS
# ifdef __clang__
# pragma clang diagnostic pop
# endif
#endif

24 changes: 23 additions & 1 deletion LCLSystemLog.m
Expand Up @@ -3,7 +3,7 @@
// LCLSystemLog.m // LCLSystemLog.m
// //
// //
// Copyright (c) 2008-2011 Arne Harren <ah@0xc0.de> // Copyright (c) 2008-2012 Arne Harren <ah@0xc0.de>
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal // of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -436,7 +436,18 @@ + (void)logWithIdentifier:(const char *)identifier_c level:(uint32_t)level
_LCLSystemLog_autoreleasepool_begin _LCLSystemLog_autoreleasepool_begin


// create log message // create log message
# ifndef _LCL_NO_IGNORE_WARNINGS
# ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wformat-nonliteral"
# endif
# endif
NSString *message = [[NSString alloc] initWithFormat:format arguments:args]; NSString *message = [[NSString alloc] initWithFormat:format arguments:args];
# ifndef _LCL_NO_IGNORE_WARNINGS
# ifdef __clang__
# pragma clang diagnostic pop
# endif
# endif
# if !__has_feature(objc_arc) # if !__has_feature(objc_arc)
[message autorelease]; [message autorelease];
# endif # endif
Expand Down Expand Up @@ -504,7 +515,18 @@ + (void)logWithIdentifier:(const char *)identifier_c lclLevel:(uint32_t)lclLevel
_LCLSystemLog_autoreleasepool_begin _LCLSystemLog_autoreleasepool_begin


// create log message // create log message
# ifndef _LCL_NO_IGNORE_WARNINGS
# ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wformat-nonliteral"
# endif
# endif
NSString *message = [[NSString alloc] initWithFormat:format arguments:args]; NSString *message = [[NSString alloc] initWithFormat:format arguments:args];
# ifndef _LCL_NO_IGNORE_WARNINGS
# ifdef __clang__
# pragma clang diagnostic pop
# endif
# endif
# if !__has_feature(objc_arc) # if !__has_feature(objc_arc)
[message autorelease]; [message autorelease];
# endif # endif
Expand Down
2 changes: 1 addition & 1 deletion LCLSystemLogConfig.template.h
Expand Up @@ -3,7 +3,7 @@
// LCLSystemLogConfig.h // LCLSystemLogConfig.h
// //
// //
// Copyright (c) 2008-2011 Arne Harren <ah@0xc0.de> // Copyright (c) 2008-2012 Arne Harren <ah@0xc0.de>
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal // of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -98,7 +98,7 @@ The following Git repositories are related to this repository:


## Copyright and License ## Copyright and License


Copyright (c) 2008-2011 Arne Harren <ah@0xc0.de> Copyright (c) 2008-2012 Arne Harren <ah@0xc0.de>


Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion lcl_config_logger.h → lcl_config_logger.template.h
Expand Up @@ -3,7 +3,7 @@
// lcl_config_logger.h // lcl_config_logger.h
// //
// //
// Copyright (c) 2008-2011 Arne Harren <ah@0xc0.de> // Copyright (c) 2008-2012 Arne Harren <ah@0xc0.de>
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal // of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit 53d42d9

Please sign in to comment.