Frameworks/Adium Framework/Source/ESDebugAILog.h
author Evan Schoenberg
Thu, 14 Nov 2019 16:22:42 -0500
branchadium-1.5.10.5
changeset 5997 d88e6711d0e0
parent 4678 6880c201b832
permissions -rw-r--r--
Fixed a triple handful of warnings
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
     1
/* 
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
     2
 * Adium is the legal property of its developers, whose names are listed in the copyright file included
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
     3
 * with this source distribution.
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
     4
 * 
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
     6
 * General Public License as published by the Free Software Foundation; either version 2 of the License,
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
     7
 * or (at your option) any later version.
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
     8
 * 
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    10
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    11
 * Public License for more details.
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    12
 * 
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    13
 * You should have received a copy of the GNU General Public License along with this program; if not,
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    14
 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    15
 */
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    16
2048
88d7a58c12b8 Make AILog always be compiled in, enabled by default in debug builds and enableable with a hidden pref in Release builds. The overhead for calling AILog when it's off is increased from nothing to completely trivial (one global var access plus one hinted branch), but I'll eat my hat if that ever matters. Putting in some sort of UI for this would be nice, but that can wait for a followup commit
David Smith <catfish.man@gmail.com>
parents: 2006
diff changeset
    17
extern NSString *const AIDebugLoggingEnabledNotification;
88d7a58c12b8 Make AILog always be compiled in, enabled by default in debug builds and enableable with a hidden pref in Release builds. The overhead for calling AILog when it's off is increased from nothing to completely trivial (one global var access plus one hinted branch), but I'll eat my hat if that ever matters. Putting in some sort of UI for this would be nice, but that can wait for a followup commit
David Smith <catfish.man@gmail.com>
parents: 2006
diff changeset
    18
extern BOOL AIDebugLoggingEnabled;
88d7a58c12b8 Make AILog always be compiled in, enabled by default in debug builds and enableable with a hidden pref in Release builds. The overhead for calling AILog when it's off is increased from nothing to completely trivial (one global var access plus one hinted branch), but I'll eat my hat if that ever matters. Putting in some sort of UI for this would be nice, but that can wait for a followup commit
David Smith <catfish.man@gmail.com>
parents: 2006
diff changeset
    19
88d7a58c12b8 Make AILog always be compiled in, enabled by default in debug builds and enableable with a hidden pref in Release builds. The overhead for calling AILog when it's off is increased from nothing to completely trivial (one global var access plus one hinted branch), but I'll eat my hat if that ever matters. Putting in some sort of UI for this would be nice, but that can wait for a followup commit
David Smith <catfish.man@gmail.com>
parents: 2006
diff changeset
    20
#define AILog(fmt, args...) do { if (__builtin_expect(AIDebugLoggingEnabled, 0)) AILog_impl(fmt, ##args); } while(0)
88d7a58c12b8 Make AILog always be compiled in, enabled by default in debug builds and enableable with a hidden pref in Release builds. The overhead for calling AILog when it's off is increased from nothing to completely trivial (one global var access plus one hinted branch), but I'll eat my hat if that ever matters. Putting in some sort of UI for this would be nice, but that can wait for a followup commit
David Smith <catfish.man@gmail.com>
parents: 2006
diff changeset
    21
#define AILogWithPrefix(sig, fmt, args...) do { if(__builtin_expect(AIDebugLoggingEnabled, 0)) AILogWithPrefix_impl(sig, fmt, ##args); } while(0)
88d7a58c12b8 Make AILog always be compiled in, enabled by default in debug builds and enableable with a hidden pref in Release builds. The overhead for calling AILog when it's off is increased from nothing to completely trivial (one global var access plus one hinted branch), but I'll eat my hat if that ever matters. Putting in some sort of UI for this would be nice, but that can wait for a followup commit
David Smith <catfish.man@gmail.com>
parents: 2006
diff changeset
    22
#define AILogBacktrace() do { if(__builtin_expect(AIDebugLoggingEnabled, 0)) AILogBacktrace_impl(); } while(0)
4678
6880c201b832 Log line numbers and the dispatch_queue's name (if it's not on the main queue) in AILogWithSignature().
Thijs Alkemade <thijsalkemade@gmail.com>
parents: 3471
diff changeset
    23
#define AILogWithSignature(fmt, args...) AILogWithSignature_impl(__PRETTY_FUNCTION__, __LINE__, fmt, ##args);
5997
d88e6711d0e0 Fixed a triple handful of warnings
Evan Schoenberg
parents: 4678
diff changeset
    24
void AIEnableDebugLogging(void);
d88e6711d0e0 Fixed a triple handful of warnings
Evan Schoenberg
parents: 4678
diff changeset
    25
BOOL AIDebugLoggingIsEnabled(void);
4678
6880c201b832 Log line numbers and the dispatch_queue's name (if it's not on the main queue) in AILogWithSignature().
Thijs Alkemade <thijsalkemade@gmail.com>
parents: 3471
diff changeset
    26
void AILogWithSignature_impl (const char *function, int line, NSString *format, ...) __attribute__((format(__NSString__, 3, 4)));
2048
88d7a58c12b8 Make AILog always be compiled in, enabled by default in debug builds and enableable with a hidden pref in Release builds. The overhead for calling AILog when it's off is increased from nothing to completely trivial (one global var access plus one hinted branch), but I'll eat my hat if that ever matters. Putting in some sort of UI for this would be nice, but that can wait for a followup commit
David Smith <catfish.man@gmail.com>
parents: 2006
diff changeset
    27
void AILogWithPrefix_impl (const char *signature, NSString *format, ...) __attribute__((format(__NSString__, 2, 3)));
88d7a58c12b8 Make AILog always be compiled in, enabled by default in debug builds and enableable with a hidden pref in Release builds. The overhead for calling AILog when it's off is increased from nothing to completely trivial (one global var access plus one hinted branch), but I'll eat my hat if that ever matters. Putting in some sort of UI for this would be nice, but that can wait for a followup commit
David Smith <catfish.man@gmail.com>
parents: 2006
diff changeset
    28
void AILog_impl (NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
5997
d88e6711d0e0 Fixed a triple handful of warnings
Evan Schoenberg
parents: 4678
diff changeset
    29
void AILogBacktrace_impl(void);