BBAJSConsole.h 1.3 KB
//
//  BBAJSConsole.h
//  SWAN
//
//  Created by baidu on 2018/8/9.
//  Copyright © 2018年 baidu. All rights reserved.
//

#import <JavaScriptCore/JavaScriptCore.h>

/** 
 * 控制台输出协议,函数调用方法为console.xxxxxxxx
 */
@protocol BBAMNPJSConsoleExports <JSExport>

/**
 * @brief log输出
 *
 * @param message 输出信息
 */
- (JSValue *)log:(JSValue *)message;

/**
 * @brief info信息输出
 *
 * @param message 输出信息
 */
- (JSValue *)info:(JSValue *)message;


/**
 * @brief debug信息输出
 *
 * @param message 输出信息  
 */
- (JSValue *)debug:(JSValue *)message;


/**
 * @brief warn信息输出
 *
 * @param message 输出信息
 */
- (JSValue *)warn:(JSValue *)message;


/**
 * @brief error信息输出
 *
 * @param message 输出信息
 */
- (JSValue *)error:(JSValue *)message;

- (JSValue *)group:(JSValue *)message;

- (JSValue *)groupEnd:(JSValue *)message;

/**
 * @brief 启动计时器
 *
 * @param timerId 计时器id
 */
- (NSString *)time:(JSValue *)timerId;


/**
 * @brief 停止计时器,返回对应计时器id的计时时间
 *
 * @param timerId 计时器id
 * @return 成功返回计时时间,失败返回-1
 */
- (NSString *)timeEnd:(JSValue *)timerId;

@end

/**
 *  封装控制台log
 *
 */
@interface BBAJSConsole : NSObject <BBAMNPJSConsoleExports>

@end