cdts/xdts-ios 3/TreeHole/CYHResetCode/CYH/QMUIKit/QMUIComponents/QMUIConsole/QMUIConsole.h

96 lines
4.0 KiB
C
Raw Permalink Normal View History

2023-07-27 09:20:00 +08:00
/**
* Tencent is pleased to support the open source community by making QMUI_iOS available.
* Copyright (C) 2016-2021 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* 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.
*/
//
// QMUIConsole.h
// QMUIKit
//
// Created by MoLice on 2019/J/11.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "QMUIConsoleToolbar.h"
#import "QMUIConsoleViewController.h"
#import "QMUILog+QMUIConsole.h"
NS_ASSUME_NONNULL_BEGIN
/**
Level/Name
1. [QMUIConsole log:...] level "Normal"name "Default"
2. [QMUIConsole logWithLevel:name:logString:] level name
3.
4.
@note DEBUG canShow
*/
@interface QMUIConsole : NSObject
+ (nonnull instancetype)sharedInstance;
/**
@param level nil @"Normal"
@param name nil @"Default"
@param logString NSString/NSAttributedString/NSObject NSString [QMUIConsole appearance].textAttributes
*/
+ (void)logWithLevel:(nullable NSString *)level name:(nullable NSString *)name logString:(id)logString;
/**
level:@"Normal" name:@"Default" log
@param logString NSString/NSAttributedString/NSObject NSString [QMUIConsole appearance].textAttributes
*/
+ (void)log:(id)logString;
/**
*/
+ (void)clear;
/**
QMUIConsole.showConsoleAutomatically YES log show
*/
+ (void)show;
/**
*/
+ (void)hide;
/// 决定控制台是否能显示出来,当值为 NO 时,即便 +show 方法被调用也不会显示控制台,默认在 DEBUG 下为 YES其他环境下为 NO。业务项目可自行修改。
/// 这个值为 NO 也不影响日志的打印,只是不会显示出来而已。
@property(nonatomic, assign) BOOL canShow;
/// 当打印 log 的时候自动让控制台显示出来,默认为 YES为 NO 时则只记录 log当手动调用 +show 方法时才会出现控制台。
@property(nonatomic, assign) BOOL showConsoleAutomatically;
/// 控制台的背景色
@property(nullable, nonatomic, strong) UIColor *backgroundColor UI_APPEARANCE_SELECTOR;
/// 控制台文本的默认样式
@property(nullable, nonatomic, strong) NSDictionary<NSAttributedStringKey, id> *textAttributes UI_APPEARANCE_SELECTOR;
/// log 里的时间戳的颜色
@property(nullable, nonatomic, strong) NSDictionary<NSAttributedStringKey, id> *timeAttributes UI_APPEARANCE_SELECTOR;
/// 搜索结果高亮的背景色
@property(nullable, nonatomic, strong) UIColor *searchResultHighlightedBackgroundColor UI_APPEARANCE_SELECTOR;
@end
@interface QMUIConsole (UIAppearance)
+ (nonnull instancetype)appearance;
@end
NS_ASSUME_NONNULL_END