-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryDebug.py
More file actions
37 lines (31 loc) · 1.24 KB
/
QueryDebug.py
File metadata and controls
37 lines (31 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# ----------------------------------------------------------------
# Author: WayneFerdon wayneferdon@hotmail.com
# Date: 2023-04-02 12:21:06
# LastEditors: WayneFerdon wayneferdon@hotmail.com
# LastEditTime: 2023-04-13 04:20:15
# FilePath: \FlowLauncher\Plugins\WoxBasePluginQuery\QueryDebug.py
# ----------------------------------------------------------------
# Copyright (c) 2023 by Wayne Ferdon Studio. All rights reserved.
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
# ----------------------------------------------------------------
import traceback
class QueryDebug:
# 静态变量
Instance=None
__flag__=False
@classmethod
def __new__(cls, *args, **kargs):
if cls.Instance is None:
cls.Instance=super().__new__(cls)
return cls.Instance
@classmethod
def __init__(cls):
if cls.__flag__:
return
cls.__flag__=True
Logs = list[str]()
@classmethod
def Log(cls, *info):
cls.Instance.Logs.append([len(cls.Instance.Logs), str(list(info))[1:-1] + "\n" + "\n".join(traceback.format_stack())])