Skip to content

Commit

Permalink
增加了代码赋值工具的配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwang committed Dec 18, 2019
1 parent 749a2fa commit 9068d18
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/code/server/codeLogManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
// https://opensource.org/licenses/BSD-3-Clause
// 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 { CodeSettings, LogLevel } from './codeSettings';

export enum LogLevel{
DEBUG = 0,
INFO = 1 ,
ERROR = 2,
RELEASE = 3
}
export class Logger {
public static currentLevel = LogLevel.RELEASE;
public static connection;
public static init() {
}
Expand All @@ -29,19 +23,19 @@ export class Logger {
}

public static DebugLog(str: string){
if( this.currentLevel <= LogLevel.DEBUG){
if( CodeSettings.logLevel <= LogLevel.DEBUG){
this.connection.console.log(str);
}
}

public static InfoLog(str: string){
if( this.currentLevel <= LogLevel.INFO){
if( CodeSettings.logLevel <= LogLevel.INFO){
this.connection.console.log(str);
}
}

public static ErrorLog(str: string){
if( this.currentLevel <= LogLevel.ERROR){
if( CodeSettings.logLevel <= LogLevel.ERROR){
this.connection.console.log(str);
}
}
Expand Down
14 changes: 14 additions & 0 deletions src/code/server/codeSettings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// 在这个文件中进行调试器的相关配置

export enum LogLevel{
DEBUG = 0,
INFO = 1 ,
ERROR = 2,
RELEASE = 3
}

export class CodeSettings{
public static logLevel = LogLevel.RELEASE;
// 调试的时候,为了方便查看信息,这里设置true . 发布版本改为 false
public static isOpenDebugInfo = false;
}

0 comments on commit 9068d18

Please sign in to comment.