shamrickus commented on code in PR #7673: URL: https://github.com/apache/trafficcontrol/pull/7673#discussion_r1284564581
########## experimental/traffic-portal/src/app/shared/logging.service.ts: ########## @@ -0,0 +1,74 @@ +/** + * @license Apache-2.0 + * + * 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. + */ + +import { Injectable } from "@angular/core"; + +import { LogLevel, Logger } from "../utils"; + +/** + * LoggingService is for logging things in a consistent way across the UI. + * + * It's basically just a thin wrapper around a {@link Logger} so that only one + * instance needs to exist and injection makes its setup consistent across all + * usages. + */ +@Injectable({ + providedIn: "root" +}) +export class LoggingService { + + public logger: Logger; + + constructor() { + this.logger = new Logger(console, LogLevel.DEBUG, "", false); Review Comment: I'd argue that should at least be configurable (with debug not being the default), but as you've mentioned configuration is not part of this PR so this is fine for now. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
