Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move logic to log to files from repy.py to nmAPI.py? #103

Open
aaaaalbert opened this issue Aug 11, 2015 · 2 comments
Open

Move logic to log to files from repy.py to nmAPI.py? #103

aaaaalbert opened this issue Aug 11, 2015 · 2 comments
Labels

Comments

@aaaaalbert
Copy link
Collaborator

repy.py currently takes two optional command-line arguments to control certain aspects of logging, set by the nodemanager when launching a sandbox:

  • The --logfile option controls where things go that sandboxed programs print using the log() RepyV2 call, and
  • the --servicelog option makes certain rare internal error messages from tracebackrepy.py go to the nodemanager log.

This introduces complexity in the Repy sandbox, so that it imports the proper logging libraries, finds log files, does log rotation, etc.

Instead, I think that the nodemanager should take care of this by redirecting the sandbox's standard streams appropriately. The Repy sandbox would get somewhat simpler; the nodemanager and sandbox separated more clearly (see also SeattleTestbed/nodemanager#119).

Furthermore, we could support much more easily other, non-Repy sandbox types that were not built with setting up logging in mind, and have things like seash's show log work transparently for them too.

What's your impression? Is this worthwhile?

@JustinCappos
Copy link
Contributor

How do we handle a program that does:

while True:
log('JUNK!\n')

On Tue, Aug 11, 2015 at 11:12 AM, aaaaalbert [email protected]
wrote:

repy.py currently takes two optional command-line arguments to control
certain aspects of logging, set by the nodemanager
https://github.com/SeattleTestbed/nodemanager/blob/master/nmAPI.py#L379-L388
when launching a sandbox:

This introduces complexity in the Repy sandbox, so that it imports the
proper logging libraries, finds log files, does log rotation, etc.

Instead, I think that the nodemanager should take care of this by
redirecting the sandbox's standard streams appropriately. The Repy sandbox
would get somewhat simpler; the nodemanager and sandbox separated more
clearly (see also SeattleTestbed/nodemanager#119
SeattleTestbed/nodemanager#119).

Furthermore, we could support much more easily other, non-Repy sandbox
types that were not built with setting up logging in mind, and have things
like seash's show log work transparently for them too.

What's your impression? Is this worthwhile?


Reply to this email directly or view it on GitHub
#103.

@aaaaalbert
Copy link
Collaborator Author

I'll assume we let this snippet run as a sandboxed program. Then, depending on how it is started,

The arg is usually only passed when the nodemanager starts the sandbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants