SRLog.m 771 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // Copyright (c) 2016-present, Facebook, Inc.
  3. // All rights reserved.
  4. //
  5. // This source code is licensed under the BSD-style license found in the
  6. // LICENSE file in the root directory of this source tree. An additional grant
  7. // of patent rights can be found in the PATENTS file in the same directory.
  8. //
  9. #import "SRLog.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. extern void SRErrorLog(NSString *format, ...)
  12. {
  13. __block va_list arg_list;
  14. va_start (arg_list, format);
  15. NSString *formattedString = [[NSString alloc] initWithFormat:format arguments:arg_list];
  16. va_end(arg_list);
  17. NSLog(@"[SocketRocket] %@", formattedString);
  18. }
  19. extern void SRDebugLog(NSString *format, ...)
  20. {
  21. #ifdef SR_DEBUG_LOG_ENABLED
  22. SRErrorLog(tag, format);
  23. #endif
  24. }
  25. NS_ASSUME_NONNULL_END