Option for mirroring all console rendering in a file#637
Conversation
|
@adamralph Is this just console messages or all log messages? We currently On Sun, Apr 27, 2014 at 5:53 PM, Adam Ralph notifications@github.comwrote:
|
|
@glennblock yes, it's all log messages. In scriptcs.exe there is effectively no difference between log and console since we don't add a common.logging adapter. We just intercept all logging calls and push them through the configured IConsole, according to the loglevel switch. If anything, the resulting file contains extra artifacts which a pure log file shouldn't, i.e. the command prompt and an echo of command input. Perhaps we could come up with a more accurate name which reflects that? |
|
this is a good change but I think the name is misleading. should be something like |
|
I agree. Any advances on |
|
It's not just output, it's input too. It's the whole console. I could also change the name of the type ( |
|
@adamralph let's get this in. Can you change it to -output? |
|
Thanks Glenn, I see this feature as nice method for someone using the REPL to capture their thought process while they're working to later reference. |
|
@glennblock sure, will do |
|
For some reason it blows up after rebasing off latest dev when I try to invoke it for REPL. I think I may have been using different command line params when I tested it previously but in honesty I can't figure out how it ever worked. I think it boils down to the fact that we special case certain params when no script path is passed. I'll try and figure things out in |
|
what's the error? |
|
The command factory never falls into any of the cases so it defaults to show usage. |
|
what are you passing in? |
|
|
|
if you want a repl you need to add REPL will only be opened if you don't have any args or only pass |
|
Ah of course, thanks! 😅 It's a bit weird from a user perspective, i.e. I type |
|
Rebased and changed from Should be ready to go. |
|
Just want to add my thoughts from a discussion earlier today. I still think it would be nice to be able to use a REPL command (#612) to output to a file. The scenario I'm thinking of would be if you have just done some work in the REPL but haven't started the REPL with This could even be extended to: Not sure if this could leverage this existing PR as a starting point. My only concern with this REPL command approach is that everything will have to be held in some form of in-memory collection by default even if the user has no intention of logging to file. Not sure if this is an issue - there is unlikely to be enough in the collection to cause memory pressure ... famous last words |
|
That's an interesting idea @paulbouwer. I've spun it off into an issue of it's own #657 I don't think this PR can be used as a base as the |
|
Given the proposed REPL command functionality, it would be very easy to Just implement IReplCommand that takes the file as param and the output On 5 May 2014 10:50, Paul Bouwer notifications@github.com wrote:
|
|
Cool, so I guess once this PR goes in, that command can reuse the |
|
Sounds good. |
There was a problem hiding this comment.
you will need to remove the shorcut as it will break with power args 2.0
|
Rebased and updated for PowerArgs 2.0. |
adds a switch for mirroring all console messages to a file
|
great - thanks |


FWIW
This has proven invaluable to me in developing Bau today. In the Bau acceptance tests I shell out scriptcs.exe and by passing this switch I can log out the console and debug things.
In REPL, it also picks up both input and output which is kind of cool. Could be quite a useful diagnostic tool when people have issues, i.e. they can log the console whilst reproducing the issue or we can request that they do it.
closes #656