//
//  HLError.h
//  HLSpriteKit
//
//  Created by Karl Voskuil on 6/6/14.
//  Copyright (c) 2014 Hilo Games. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 The error level for logging non-critical errors using `HLError()`.
*/
typedef NS_ENUM(NSInteger, HLErrorLevel) {
  /**
   Errors.
  */
  HLLevelError,
  /**
   Warnings.
  */
  HLLevelWarning,
  /**
   Information.
  */
  HLLevelInfo,
};

/**
 Logs a non-critical error.
*/
static inline void
HLError(HLErrorLevel level, NSString *message)
{
  // TODO: This is a placeholder for a better mechanism for non-critical error logging,
  // e.g. CocoaLumberjack.
  NSString *levelLabel;
  switch (level) {
    case HLLevelInfo:
      levelLabel = @"INFO";
      break;
    case HLLevelWarning:
      levelLabel = @"WARNING";
      break;
    case HLLevelError:
      levelLabel = @"ERROR";
      break;
  }
  NSLog(@"%@: %@", levelLabel, message);
}

//
//  HLError.h
//  HLSpriteKit
//
//  Created by Karl Voskuil on 6/6/14.
//  Copyright (c) 2014 Hilo Games. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 The error level for logging non-critical errors using `HLError()`.
*/
typedef NS_ENUM(NSInteger, HLErrorLevel) {
  /**
   Errors.
  */
  HLLevelError,
  /**
   Warnings.
  */
  HLLevelWarning,
  /**
   Information.
  */
  HLLevelInfo,
};

/**
 Logs a non-critical error.
*/
static void
HLError(HLErrorLevel level, NSString *message)
{
  // TODO: This is a placeholder for a better mechanism for non-critical error logging,
  // e.g. CocoaLumberjack.
  NSString *levelLabel;
  switch (level) {
    case HLLevelInfo:
      levelLabel = @"INFO";
      break;
    case HLLevelWarning:
      levelLabel = @"WARNING";
      break;
    case HLLevelError:
      levelLabel = @"ERROR";
      break;
  }
  NSLog(@"%@: %@", levelLabel, message);
}

--- 
+++ 
@@ -29,7 +29,7 @@
 /**
  Logs a non-critical error.
 */
-static void
+static inline void
 HLError(HLErrorLevel level, NSString *message)
 {
   // TODO: This is a placeholder for a better mechanism for non-critical error logging,
Fix compiler warning for unused function.
