//
//  SHLog.h
//  SHPlayer
//
//  Created by moyanjwb on 13-3-25.
//  Copyright (c) 2013年 moyanjwb. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum SHLogType
{
    SHLog_Debug = 0,
    SHLog_Describle,
    SHLog_Error
}SHLogType;

@interface SHLog : NSObject
{
    NSFileHandle*       _logFile;
    NSOperationQueue*   _logQueue;
    NSString*           _logPath;
    SHLogType           _logType;
}
+(SHLog*) shareObject;
-(void)setLogDir:(NSString*)dir;
-(void)setLogType:(SHLogType)type;
-(void)writeLog:(SHLogType)type log:(NSString*)log;
-(void)writeLog:(SHLogType)type format:(NSString*)format,...;
-(void)save;
-(void)stop;
-(NSString*)logPath;
@end


#define SHLOG(type,s,...) [[SHLog shareObject] writeLog:type  format:(s),##__VA_ARGS__]
#define SHDEBUG(s,...) SHLOG(SHLog_Debug,s,##__VA_ARGS__)
#define SHERROR(s,...) SHLOG(SHLog_Error,s,##__VA_ARGS__)
#define SHDESC(s,...)  SHLOG(SHLog_Describle,s,##__VA_ARGS__)