@@ -15727,6 +15727,7 @@ const defaultLoggerConfig = {
1572715727 color: Color.Default,
1572815728 tag: 'ghmattimysql',
1572915729 level: '',
15730+ logLevel: 15,
1573015731 output: OutputDestination.None
1573115732};
1573215733
@@ -15856,13 +15857,33 @@ function writeConsole(msg, options) {
1585615857}
1585715858
1585815859/* harmony default export */ var logger_writeConsole = (writeConsole);
15860+ // CONCATENATED MODULE: ./vendor/ghmattimysql/packages/ghmattimysql/src/server/logger/logLevel.ts
15861+ var LogLevel;
15862+
15863+ (function (LogLevel) {
15864+ LogLevel[LogLevel["Info"] = 0] = "Info";
15865+ LogLevel[LogLevel["Success"] = 1] = "Success";
15866+ LogLevel[LogLevel["Warning"] = 2] = "Warning";
15867+ LogLevel[LogLevel["Error"] = 3] = "Error";
15868+ })(LogLevel || (LogLevel = {}));
15869+
15870+ /* harmony default export */ var logger_logLevel = (LogLevel);
15871+ // CONCATENATED MODULE: ./vendor/ghmattimysql/packages/ghmattimysql/src/server/logger/getLoggingFileName.ts
15872+ function getLoggingFileName() {
15873+ const loggingFile = GetConvar('mysql_log_file_format', '%s-%d.log');
15874+ return loggingFile.replace('%s', GetCurrentResourceName()).replace('%d', Date.now().toString());
15875+ }
15876+
15877+ /* harmony default export */ var logger_getLoggingFileName = (getLoggingFileName);
1585915878// CONCATENATED MODULE: ./vendor/ghmattimysql/packages/ghmattimysql/src/server/logger/index.ts
1586015879
1586115880
1586215881
1586315882
1586415883
1586515884
15885+
15886+
1586615887class logger_Logger {
1586715888 constructor(outputString, defaultOverRides) {
1586815889 const output = OutputDestination[outputString] || OutputDestination.None;
@@ -15873,7 +15894,7 @@ class logger_Logger {
1587315894 this.loggingFile = null;
1587415895
1587515896 if (this.defaultConfig.output === OutputDestination.File || this.defaultConfig.output === OutputDestination.FileAndConsole) {
15876- this.loggingFile = `./${GetCurrentResourceName()}-${Date.now()}.log` ;
15897+ this.loggingFile = logger_getLoggingFileName() ;
1587715898 Object(external_fs_["closeSync"])(Object(external_fs_["openSync"])(this.loggingFile, 'w'));
1587815899 }
1587915900 }
@@ -15903,13 +15924,21 @@ class logger_Logger {
1590315924 logger_writeConsole(msg, opts);
1590415925 this.writeFile(msg, opts);
1590515926 break;
15927+
15928+ default:
1590615929 }
1590715930 }
1590815931
15932+ getOutputDestination(logLevel) {
15933+ /* eslint no-bitwise: ["error", { "allow": ["&", "<<"] }] */
15934+ const logToConsole = (this.defaultConfig.logLevel & 1 << logLevel) !== 0;
15935+ return logToConsole ? OutputDestination.FileAndConsole : OutputDestination.File;
15936+ }
15937+
1590915938 error(msg, options = {}) {
1591015939 this.log(msg, {
1591115940 color: Color.Error,
15912- output: OutputDestination.FileAndConsole ,
15941+ output: this.getOutputDestination(logger_logLevel.Error) ,
1591315942 level: 'ERROR',
1591415943 ...options
1591515944 });
@@ -15918,7 +15947,7 @@ class logger_Logger {
1591815947 info(msg, options = {}) {
1591915948 this.log(msg, {
1592015949 color: Color.Info,
15921- output: OutputDestination.FileAndConsole ,
15950+ output: this.getOutputDestination(logger_logLevel.Info) ,
1592215951 level: 'INFO',
1592315952 ...options
1592415953 });
@@ -15927,7 +15956,7 @@ class logger_Logger {
1592715956 success(msg, options = {}) {
1592815957 this.log(msg, {
1592915958 color: Color.Success,
15930- output: OutputDestination.FileAndConsole ,
15959+ output: this.getOutputDestination(logger_logLevel.Success) ,
1593115960 level: 'SUCCESS',
1593215961 ...options
1593315962 });
@@ -15936,7 +15965,7 @@ class logger_Logger {
1593615965 warning(msg, options = {}) {
1593715966 this.log(msg, {
1593815967 color: Color.Warning,
15939- output: OutputDestination.FileAndConsole ,
15968+ output: this.getOutputDestination(logger_logLevel.Warning) ,
1594015969 level: 'WARNING',
1594115970 ...options
1594215971 });
@@ -16071,7 +16100,9 @@ class profiler_Profiler {
1607116100
1607216101class server_Server {
1607316102 constructor(config, loggerOverrides = {}) {
16074- this.logger = new server_logger(GetConvar('mysql_debug', 'None'), loggerOverrides);
16103+ this.logger = new server_logger(GetConvar('mysql_debug', 'None'), { ...loggerOverrides,
16104+ logLevel: GetConvarInt('mysql_log_level', 15)
16105+ });
1607516106 this.profiler = new server_profiler({
1607616107 slowQueryWarningTime: GetConvarInt('mysql_slow_query_warning', 150)
1607716108 }, this.logger);
0 commit comments