Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

[[ Log ]] log command and logMessage global property#6782

Merged
runrevmark merged 4 commits into
livecode:developfrom
montegoulding:log
May 9, 2019
Merged

[[ Log ]] log command and logMessage global property#6782
runrevmark merged 4 commits into
livecode:developfrom
montegoulding:log

Conversation

@montegoulding

Copy link
Copy Markdown
Contributor

No description provided.

@runrevmark

Copy link
Copy Markdown
Contributor

So this patch gives us:

  log [ { <expr>, ',' } ]

However, as discussed offline it would be nice if it could be extended to allow:

  log [ UQL+ ] [ { <expr>, ',' }]

This would allow things like:

  log "normal foo"
  log debug "debug foo"
  log assert x >= 1
  log start timing "something to benchmark"
  log finish timing

I had suggested previously that we could make the logMessage property of array type - however that is slightly irksome as you can't have array-valued properties which take an empty key - which would be the obvious thing to use for log "normal foo".

So perhaps, instead, we should keep logMessage for the 'untagged' form; and then we can add (at a later date) the logLevelMessage array property - which allows different messages to be used for each specified log level.

[ The above approach would mean that we don't need to worry about forward compatibility of logMessage :) ]

@runrevmark

Copy link
Copy Markdown
Contributor

So this seems to be failing when running the testsuite through the server engine (the log tests are failing too, but that's a separate thing). The individual test lines which are usual output to the test log file are being emitted to stdout/stderr.

else
TestDiagnostic it
end if
TestAssert "log message" && tLogMessage, word 1 to -1 of line 1 of it is true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@runrevmark are you sure there's an issue on server? We dump the log on failure. I think there might be an issue with the test not handling the mix of stdout and stderr we get in shell here. I'm thinking that rather than testing for true we generate a uuid and check it's somewhere in the output.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well there's definitely a difference between what is emitted when running the tests in the standalone engine compared to the server engine (the log tests fail in the standalone test phase, but doesn't end up meaning all the individual 'ok' lines get dumped to stdout/stderr at the end, as far as I can see at least...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's running under the server engine is it? I can't access more than the normal output for standalone test phase then the dumped log

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah - sorry - you are right - not sure where I thought I saw server ;) So, yes - this is just because the log tests are failing :D

montegoulding and others added 4 commits May 9, 2019 08:41
This patch adds tests for using the log command when the log message
is empty, and when it is set to the name of a public handler and a
private handler.
@runrevmark

Copy link
Copy Markdown
Contributor

@livecode-vulcan review ok 318de49

@livecode-vulcan

Copy link
Copy Markdown
Contributor

💙 review by @runrevmark ok 318de49

livecode-vulcan added a commit that referenced this pull request May 9, 2019
[[ Log ]] log command and logMessage global property
@livecode-vulcan

Copy link
Copy Markdown
Contributor

😎 test success 318de49

  • try-community-armv6-android-sdk26_ndk16r15: success
  • try-community-armv7-android-sdk26_ndk16r15: success
  • try-community-arm64-android-sdk26_ndk16r15: success
  • try-community-x86-android-sdk26_ndk16r15: success
  • try-community-x86_64-android-sdk26_ndk16r15: success
  • try-community-js-emscripten-sdk1.35: success
  • try-community-universal-ios-iphoneos12.1: success
  • try-community-universal-ios-iphonesimulator12.1: success
  • try-community-universal-mac-macosx10.9: success
  • try-community-x86-linux-debian8: success
  • try-community-x86_64-linux-debian8: success
  • try-community-x86-win32: success
  • try-community-x86_64-win32: success

@runrevmark runrevmark merged commit 2047189 into livecode:develop May 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants