-
-
Save majirosstefan/224c0907445c3daa7bb50409df9f6db0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func RCTLogError(_ message: String, _ file: String=#file, _ line: UInt=#line) { | |
RCTSwiftLog.error(message, file: file, line: line) | |
} | |
func RCTLogWarn(_ message: String, _ file: String=#file, _ line: UInt=#line) { | |
RCTSwiftLog.warn(message, file: file, line: line) | |
} | |
func RCTLogInfo(_ message: String, _ file: String=#file, _ line: UInt=#line) { | |
RCTSwiftLog.info(message, file: file, line: line) | |
} | |
func RCTLog(_ message: String, _ file: String=#file, _ line: UInt=#line) { | |
RCTSwiftLog.log(message, file: file, line: line) | |
} | |
func RCTLogTrace(_ message: String, _ file: String=#file, _ line: UInt=#line) { | |
RCTSwiftLog.trace(message, file: file, line: line) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RCTSwiftLog.h | |
// | |
// | |
// Created by Jimmy Dee on 4/5/17. | |
// | |
// | |
#import <Foundation/Foundation.h> | |
@interface RCTSwiftLog : NSObject | |
+ (void)error:(NSString * _Nonnull)message file:(NSString * _Nonnull)file line:(NSUInteger)line; | |
+ (void)warn:(NSString * _Nonnull)message file:(NSString * _Nonnull)file line:(NSUInteger)line; | |
+ (void)info:(NSString * _Nonnull)message file:(NSString * _Nonnull)file line:(NSUInteger)line; | |
+ (void)log:(NSString * _Nonnull)message file:(NSString * _Nonnull)file line:(NSUInteger)line; | |
+ (void)trace:(NSString * _Nonnull)message file:(NSString * _Nonnull)file line:(NSUInteger)line; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RCTSwiftLog.m | |
// | |
// | |
// Created by Jimmy Dee on 4/5/17. | |
// | |
// | |
#import <React/RCTLog.h> | |
#import "RCTSwiftLog.h" | |
@implementation RCTSwiftLog | |
+ (void)info:(NSString *)message file:(NSString *)file line:(NSUInteger)line | |
{ | |
_RCTLogNativeInternal(RCTLogLevelInfo, file.UTF8String, (int)line, @"%@", message); | |
} | |
+ (void)warn:(NSString *)message file:(NSString *)file line:(NSUInteger)line | |
{ | |
_RCTLogNativeInternal(RCTLogLevelWarning, file.UTF8String, (int)line, @"%@", message); | |
} | |
+ (void)error:(NSString *)message file:(NSString *)file line:(NSUInteger)line | |
{ | |
_RCTLogNativeInternal(RCTLogLevelError, file.UTF8String, (int)line, @"%@", message); | |
} | |
+ (void)log:(NSString *)message file:(NSString *)file line:(NSUInteger)line | |
{ | |
_RCTLogNativeInternal(RCTLogLevelInfo, file.UTF8String, (int)line, @"%@", message); | |
} | |
+ (void)trace:(NSString *)message file:(NSString *)file line:(NSUInteger)line | |
{ | |
_RCTLogNativeInternal(RCTLogLevelTrace, file.UTF8String, (int)line, @"%@", message); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment