You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -3046,6 +3126,12 @@ local function _processFileOrString(params, isFile)
3046
3126
outputFromMetaStack= {outputFromMeta}
3047
3127
canOutputNil=params.canOutputNil~=false
3048
3128
fastStrings=params.fastStrings
3129
+
releaseMode=params.release
3130
+
maxLogLevel=params.logLevelor"trace"
3131
+
3132
+
ifnotLOG_LEVELS[maxLogLevel] then
3133
+
errorf(2, "Invalid 'logLevel' value in params. (%s)", maxLogLevel)
3134
+
end
3049
3135
3050
3136
ifparams.pathMetathen
3051
3137
localfile=assert(io.open(params.pathMeta, "wb"))
@@ -3084,6 +3170,8 @@ local function _processFileOrString(params, isFile)
3084
3170
outputFromMetaStack=nil
3085
3171
outputFromMeta=nil
3086
3172
canOutputNil=true
3173
+
releaseMode=false
3174
+
maxLogLevel="trace"
3087
3175
3088
3176
ifparams.onAfterMetathen
3089
3177
localluaModified=params.onAfterMeta(lua)
@@ -3194,6 +3282,8 @@ local function processFileOrString(params, isFile)
3194
3282
fastStrings=false
3195
3283
macroPrefix=""
3196
3284
macroSuffix=""
3285
+
releaseMode=false
3286
+
maxLogLevel="trace"
3197
3287
3198
3288
ifxpcallOkthen
3199
3289
returnunpack(returnValues, 1, returnValues.n)
@@ -3245,6 +3335,9 @@ local pp = {
3245
3335
-- macroPrefix = prefix -- [Optional] String to prepend to macro names. (Default: "")
3246
3336
-- macroSuffix = suffix -- [Optional] String to append to macro names. (Default: "")
3247
3337
--
3338
+
-- release = boolean -- [Optional] Enable release mode. Currently only disables the @@ASSERT() macro when true. (Default: false)
3339
+
-- logLevel = levelName -- [Optional] Maximum log level for the @@LOG() macro. Can be "off", "error", "warning", "info", "debug" or "trace". (Default: "trace", which enables all logging)
3340
+
--
3248
3341
-- onInsert = function( name ) -- [Optional] Called for each @insert"name" instruction. It's expected to return a Lua code string. By default 'name' is a path to a file to be inserted.
3249
3342
-- onBeforeMeta = function( ) -- [Optional] Called before the metaprogram runs.
3250
3343
-- onAfterMeta = function( luaString ) -- [Optional] Here you can modify and return the Lua code before it's written to 'pathOut'.
@@ -3274,6 +3367,9 @@ local pp = {
3274
3367
-- macroPrefix = prefix -- [Optional] String to prepend to macro names. (Default: "")
3275
3368
-- macroSuffix = suffix -- [Optional] String to append to macro names. (Default: "")
3276
3369
--
3370
+
-- release = boolean -- [Optional] Enable release mode. Currently only disables the @@ASSERT() macro when true. (Default: false)
3371
+
-- logLevel = levelName -- [Optional] Maximum log level for the @@LOG() macro. Can be "off", "error", "warning", "info", "debug" or "trace". (Default: "trace", which enables all logging)
3372
+
--
3277
3373
-- onInsert = function( name ) -- [Optional] Called for each @insert"name" instruction. It's expected to return a Lua code string. By default 'name' is a path to a file to be inserted.
3278
3374
-- onBeforeMeta = function( ) -- [Optional] Called before the metaprogram runs.
3279
3375
-- onError = function( error ) -- [Optional] You can use this to get traceback information. 'error' is the same value as the second returned value from processString().
0 commit comments