UNPKG

@btfuse/core

Version:

A native-first framework for building hybdrid web-native applications

51 lines (48 loc) 1.74 kB
"use strict"; /* Copyright 2023 Breautek Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.FuseLoggerFactory = void 0; const FuseLogger_1 = require("./FuseLogger"); const Platform_1 = require("./Platform"); const IOSFuseLogger_1 = require("./ios/IOSFuseLogger"); const AndroidFuseLogger_1 = require("./android/AndroidFuseLogger"); /** * A default logger factory for creating loggers for the given platform. */ class FuseLoggerFactory { /** * * @param platform - The current Platform in this runtime environment */ constructor(platform) { this.$platform = platform; } /** * Creates a FuseLogger for the current Platform. * * @returns A logger instance */ create() { switch (this.$platform) { case Platform_1.Platform.IOS: return new IOSFuseLogger_1.IOSFuseLogger(); case Platform_1.Platform.ANDROID: return new AndroidFuseLogger_1.AndroidFuseLogger(); case Platform_1.Platform.TEST: return new FuseLogger_1.FuseLogger(); } } } exports.FuseLoggerFactory = FuseLoggerFactory; //# sourceMappingURL=FuseLoggerFactory.js.map