Skip to content

Commit

Permalink
missing loggings with self.showDebugLog condition
Browse files Browse the repository at this point in the history
  • Loading branch information
tastyone committed Dec 6, 2013
1 parent ed65a28 commit db3be00
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions MotionOrientation.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ - (void)_initialize
self.motionManager = [[CMMotionManager alloc] init];
self.motionManager.accelerometerUpdateInterval = 0.1;
if ( ![self.motionManager isAccelerometerAvailable] ) {
NSLog(@"MotionOrientation - Accelerometer is NOT available");
if ( self.showDebugLog ) {
NSLog(@"MotionOrientation - Accelerometer is NOT available");
}
#ifdef __i386__
[self simulatorInit];
#endif
Expand Down Expand Up @@ -98,14 +100,18 @@ - (CGAffineTransform)affineTransform
default:
break;
}
NSLog(@"affineTransform degree: %d", rotationDegree);
if ( self.showDebugLog ) {
NSLog(@"affineTransform degree: %d", rotationDegree);
}
return CGAffineTransformMakeRotation(MO_degreesToRadian(rotationDegree));
}

- (void)accelerometerUpdateWithData:(CMAccelerometerData *)accelerometerData error:(NSError *)error
{
if ( error ) {
NSLog(@"accelerometerUpdateERROR: %@", error);
if ( self.showDebugLog ) {
NSLog(@"accelerometerUpdateERROR: %@", error);
}
return;
}

Expand Down Expand Up @@ -200,14 +206,12 @@ - (void)accelerometerUpdateWithData:(CMAccelerometerData *)accelerometerData err
[[NSNotificationCenter defaultCenter] postNotificationName:MotionOrientationChangedNotification
object:nil
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:self, kMotionOrientationKey, nil]];
#ifdef DEBUG
if ( self.showDebugLog ) {
NSLog(@"didAccelerate: absoluteZ: %f angle: %f (x: %f, y: %f, z: %f), orientationString: %@",
absoluteZ, angle,
acceleration.x, acceleration.y, acceleration.z,
orientationString);
}
#endif
}
if ( interfaceOrientationChanged ) {
[[NSNotificationCenter defaultCenter] postNotificationName:MotionOrientationInterfaceOrientationChangedNotification
Expand Down

0 comments on commit db3be00

Please sign in to comment.