Skip to content

Commit

Permalink
added loglvl function to console extension
Browse files Browse the repository at this point in the history
  • Loading branch information
jpswinski committed Sep 20, 2022
1 parent 13d01f3 commit 035d2e0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ __pycache__
.cookies
.cache/
cscope.*

*.log
2 changes: 1 addition & 1 deletion packages/aws/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (AWSSDK_LINK_LIBRARIES)

target_compile_definitions (slideruleLib PUBLIC __aws__)

#target_compile_options (slideruleLib PUBLIC "$<$<CONFIG:Debug>:-DENABLE_AWS_LOGGING>")
target_compile_options (slideruleLib PUBLIC "$<$<CONFIG:Debug>:-DENABLE_AWS_LOGGING>")

target_link_libraries (slideruleLib PUBLIC ${AWSSDK_LINK_LIBRARIES})

Expand Down
6 changes: 3 additions & 3 deletions plugins/icesat2/selftests/asset_directory.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asset, format, path, index, region, endpoint
nsidc-s3, cumulus, nsidc-cumulus-prod-protected, empty.index, us-west-2, https://s3.us-west-2.amazonaws.com
atlas-s3, s3, icesat2-sliderule/data/ATLAS, empty.index, us-west-2, https://s3.us-west-2.amazonaws.com
atlas-local, file, /data/ATLAS, empty.index, local, local
nsidc-s3, cumulus, nsidc-cumulus-prod-protected, empty.index, us-west-2, https://s3.us-west-2.amazonaws.com
atlas-s3, s3, icesat2-sliderule/data/ATLAS, empty.index, us-west-2, https://s3.us-west-2.amazonaws.com
atlas-local, file, /data/ATLAS, empty.index, local, local
10 changes: 8 additions & 2 deletions plugins/icesat2/selftests/h5_file.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
local runner = require("test_executive")
local console = require("console")
local asset = require("asset")
local pp = require("prettyprint")

local asset = "atlas-s3"
-- Setup --

console.loglvl(core.DEBUG)

local assets = asset.loaddir() -- looks for asset_directory.csv in same directory this script is located in
local atlas_asset = core.getbyname("atlas-s3")
local resource = "ATL03_20181015231931_02650102_003_01.h5"

-- Unit Test --

local f = h5.file(asset, resource)
local f = h5.file(atlas_asset, resource)
local rspq = msg.subscribe("h5testq")

f:read({{dataset="ancillary_data/atlas_sdp_gps_epoch"}}, "h5testq")
Expand Down
6 changes: 6 additions & 0 deletions scripts/extensions/console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ local console_dispatcher = core.dispatcher(core.EVENTQ):name("console.dispatcher
console_dispatcher:attach(console_monitor, "eventrec")
console_dispatcher:run()

local function loglvl (lvl)
console_monitor:config(core.LOG, lvl)
sys.setlvl(core.LOG, lvl)
end

local package = {
dispatcher = console_dispatcher,
monitor = console_monitor,
loglvl = loglvl
}

return package

0 comments on commit 035d2e0

Please sign in to comment.