Logger.swift 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // Copyright 2022 Google LLC
  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. import Foundation
  16. @_implementationOnly import FirebaseCoreExtension
  17. enum Logger {
  18. private static let logServiceTag = "[FirebaseSessions]"
  19. private static let logCode = "I-SES000000"
  20. static func logInfo(_ message: String) {
  21. FirebaseLogger.log(
  22. level: .info,
  23. service: logServiceTag,
  24. code: logCode,
  25. message: message
  26. )
  27. }
  28. static func logDebug(_ message: String) {
  29. FirebaseLogger.log(
  30. level: .debug,
  31. service: logServiceTag,
  32. code: logCode,
  33. message: message
  34. )
  35. }
  36. static func logWarning(_ message: String) {
  37. FirebaseLogger.log(
  38. level: .warning,
  39. service: logServiceTag,
  40. code: logCode,
  41. message: message
  42. )
  43. }
  44. static func logError(_ message: String) {
  45. FirebaseLogger.log(
  46. level: .error,
  47. service: logServiceTag,
  48. code: logCode,
  49. message: message
  50. )
  51. }
  52. }