NXLogging is a modern and easy-to-use logging framework for Objective C and Swift on iOS. It was designed with the programmer's efficiency in mind and using it for logging remains as simple as writing NSLog(...) while allowing broad control, flexibility and extensibility.
Main goals of NXLogging:
- Keep logging as easy as using NSLog(...).
- Support debug console and system log out of the box.
- Log useful information about the caller, e.g. file and function.
- Take special care of logging NSError, NSException and ErrorType.
- No ramp-up code and configuration necessary.
- Simple, understandable API for customisation and extension.
Download the NXLogging Xcode-Project and build the Universal Framework target. Add the resulting NXLogging.framework to the Embedded Binaries of your own project (in Xcode's General section of your build target).
@import NXLogging; // or: #import <NXLogging/NXLogging.h>
NXLog(NXLogLevelInfo, @"A simple log message");
NXLog(NXLogLevelInfo, @"A simple log message with an %@", @"argument");
import NXLogging
NXLog(NXLogLevel.Info, "A simple log message");
NXLog(NXLogLevel.Info, "A simple log message with an %@", "argument");
While NXLogging offers the above C-style functions to Swift programmers, too, consider using the more flexible native API:
NXLogger.log(NXLogLevel.Info, format: "A simple log message")
NXLogger.log(NXLogLevel.Info, format: "A simple log message with an %@", "argument")
In principle you can stop reading here, and just start using the NXLogging framework. However, we strongly encourage you to take a few more minutes and delve into
- Advanced logging - Log levels, logging of errors and exceptions, variables
- Architecture - Concepts of the framework
- Customisation - Customised log output
- Extensions - Extending the framework
We hope, you will enjoy NXLogging and wish you happy coding!
NXLogging is licensed under the Simplified BSD License:
Copyright (c) 2016, Naxos Software Solutions GmbH. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.