[ios, macos] Logging. (#13235)

* [ios, macos] Update the logging subsystem to platform agnostic.

* [ios, macos] Add coordinate to string function.

* [ios, macos] Add BOOL to string function.

* [ios, macos] Add tracing logs.

* [ios, macos] Add tracing logs to generated style classes.

* [ios, macos] Split logging categories accordingly to MGLLoggingLevel.

* [ios, macos] Log network requests.

* [ios, macos] Migrate NSAssert to MGLAssert.

* [ios, macos] Include MGLLoggingConfiguration to filesource-files.txt.

* [ios, macos] Fix logger string specifier for the line parameter.

* [ios, macos] Add logs to shapes classes.

* [ios, macos] Add logs to offline classes.

* [ios, macos] Add logs to annotation classes.

* [ios, macos] Add logs to foundation classes.

* [ios, macos] Fix snapshotter size logging.

* [macos] Add logs to map view.

* [ios, macos] Fix string from boolean prefix, add custom function for NSCAssert.

* Log size test

* [ios, macos] Add logging conditional compilation flag.

* [ios, macos] Rename function NSStringFromMGLTransition to MGLStringFromMGLTransition.

* [ios, macos] Remove verbose logging for release builds.

* [ios, macos] Rename NSStringFromCLLocationCoordinate2D to MGLStringFromCLLocationCoordinate2D.

* [ios, macos] Clean unnecesary blank lines in MGLLight.mm set methods.

* [ios, macos] Fix logging grammar, format, function names.

* [ios, macos] Remove compilation flag, rename flags.
This commit is contained in:
Fabian Guerra Soto
2018-11-14 15:42:18 -08:00
committed by GitHub
parent 86677b97c6
commit c8fbcfd322
48 changed files with 721 additions and 71 deletions

View File

@@ -1,6 +1,7 @@
#import "MGLPointCollection_Private.h"
#import "MGLGeometry_Private.h"
#import "NSArray+MGLAdditions.h"
#import "MGLLoggingConfiguration_Private.h"
#import <mbgl/util/geojson.hpp>
#import <mbgl/util/geometry.hpp>
@@ -20,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count
{
MGLLogDebug(@"Initializing with %lu coordinates.", (unsigned long)count);
self = [super init];
if (self)
{
@@ -29,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
}
- (nullable instancetype)initWithCoder:(NSCoder *)decoder {
MGLLogInfo(@"Initializing with coder.O");
if (self = [super initWithCoder:decoder]) {
NSArray *coordinates = [decoder decodeObjectOfClass:[NSArray class] forKey:@"coordinates"];
_coordinates = [coordinates mgl_coordinates];
@@ -77,7 +80,7 @@ NS_ASSUME_NONNULL_BEGIN
- (CLLocationCoordinate2D)coordinate
{
NSAssert([self pointCount] > 0, @"A multipoint must have coordinates");
MGLAssert([self pointCount] > 0, @"A multipoint must have coordinates");
return _coordinates.at(0);
}