// override default JSCocoa implementation
function log(str)
{
__jsc__.qlog_('' + str)
}
// explicit quiet log
function qlog(str)
{
__jsc__.qlog_('' + str)
}
// verbose log uses the default JSCocoa implementation
function vlog(str)
{
__jsc__.log_('' + str)
}
#import <Foundation/Foundation.h>
/*
QuietLog
*/
void QuietLog (NSString *format, ...) {
va_list argList;
va_start (argList, format);
NSString *message = [[NSString alloc] initWithFormat: format arguments: argList]; // autorelease if not ARC
va_end (argList);
fprintf (stderr, "%s\n", [message UTF8String]);
}
@implementation JSCocoaController (Mugginsoft)
/*
+ qlog
*/
+ (void)qlog:(NSString *)value
{
QuietLog(@"%@", value);
}
/*
- qlog
*/
- (void)qlog:(NSString *)value
{
QuietLog(@"%@", value);
}
@end