You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LogBridge.m 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright @ 2019-present 8x8, Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <React/RCTBridgeModule.h>
  17. #import "LogUtils.h"
  18. @interface LogBridge : NSObject<RCTBridgeModule>
  19. @end
  20. @implementation LogBridge
  21. RCT_EXPORT_MODULE();
  22. + (BOOL)requiresMainQueueSetup {
  23. return NO;
  24. }
  25. RCT_EXPORT_METHOD(trace:(NSString *)msg) {
  26. DDLogDebug(@"%@", msg);
  27. }
  28. RCT_EXPORT_METHOD(debug:(NSString *)msg) {
  29. DDLogDebug(@"%@", msg);
  30. }
  31. RCT_EXPORT_METHOD(info:(NSString *)msg) {
  32. DDLogInfo(@"%@", msg);
  33. }
  34. RCT_EXPORT_METHOD(log:(NSString *)msg) {
  35. DDLogInfo(@"%@", msg);
  36. }
  37. RCT_EXPORT_METHOD(warn:(NSString *)msg) {
  38. DDLogWarn(@"%@", msg);
  39. }
  40. RCT_EXPORT_METHOD(error:(NSString *)msg) {
  41. DDLogError(@"%@", msg);
  42. }
  43. @end