A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/0xced/XCDLumberjackNSLogger below:

0xced/XCDLumberjackNSLogger: CocoaLumberjack logger which sends logs to NSLogger

XCDLumberjackNSLogger is a CocoaLumberjack logger which sends logs to NSLogger.

XCDLumberjackNSLogger is available through CocoaPods and Carthage.

CocoaPods:

pod "XCDLumberjackNSLogger", "~> 1.1"

Carthage:

github "0xced/XCDLumberjackNSLogger" ~> 1.1

XCDLumberjackNSLogger is fully documented.

The easiest way to use XCDLumberjackNSLogger is to bind a logger to a user defaults key.

[XCDLumberjackNSLogger bindToBonjourServiceNameUserDefaultsKey:@"NSLoggerBonjourServiceName" configurationHandler:nil];

Anytime you change the user defaults key (NSLoggerBonjourServiceName in this example), the logger reconnects to the desktop viewer with the given service name.

You can change the service name user defaults manually with

[[NSUserDefaults standardUserDefaults] setObject:serviceName forKey:@"NSLoggerBonjourServiceName"];

or with a Settings bundle:

<dict>
	<key>AutocapitalizationType</key>
	<string>None</string>
	<key>AutocorrectionType</key>
	<string>No</string>
	<key>DefaultValue</key>
	<string></string>
	<key>IsSecure</key>
	<false/>
	<key>Key</key>
	<string>NSLoggerBonjourServiceName</string>
	<key>KeyboardType</key>
	<string>Alphabet</string>
	<key>Title</key>
	<string>NSLogger Service Name</string>
	<key>Type</key>
	<string>PSTextFieldSpecifier</string>
</dict>

This is very handy to get logs even in the App Store with zero overhead. Just open the settings of your app (in the iOS Settings app) and change the service name to automatically activate the logger.

When debugging with Xcode you can set -NSLoggerBonjourServiceName "Your Service Name" in Arguments Passed On Launch in your scheme to set the NSLoggerBonjourServiceName user default.

Simply send logs to NSLogger
[DDLog addLogger:[XCDLumberjackNSLogger new]];
Configuring a bonjour service name
NSString *bonjourServiceName = [[[NSProcessInfo processInfo] environment] objectForKey:@"NSLOGGER_BONJOUR_SERVICE_NAME"];
[DDLog addLogger:[[XCDLumberjackNSLogger alloc] initWithBonjourServiceName:bonjourServiceName]];
Translating contexts to tags
XCDLumberjackNSLogger *logger = [XCDLumberjackNSLogger new];
logger.tags = @{ @80 : @"CocoaHTTPServer", @((NSInteger)0xced70676) : @"XCDYouTubeKit" };
[DDLog addLogger:logger];
Configuring a viewer host
XCDLumberjackNSLogger *logger = [XCDLumberjackNSLogger new];
LoggerSetViewerHost(logger.logger, CFSTR("10.0.1.7"), 50000);
[DDLog addLogger:logger];

Cédric Luthi

XCDLumberjackNSLogger is available under the MIT license. See the LICENSE file for more information.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4