Skip to content
Snippets Groups Projects
  • Nat Goodspeed's avatar
    07134aae
    DRTVWR-476: Try to extend stderr redirection to Windows as well. · 07134aae
    Nat Goodspeed authored
    Make the LLError::Settings LLSingleton duplicate the file handle for stderr
    (usually 2) on construction. Make its destructor restore the original target
    for that file handle. Provide a getDupStderr() method to obtain the duplicate
    file handle.
    
    Move Settings declaration up to the top of the file so other code can
    reference it.
    
    Make RecordToFile (the Recorder subclass engaged by LLError::logToFile()),
    instead of duplicating stderr's file handle itself, capture the duplicate
    stderr file handle from Settings to revert stderr redirection on destruction.
    
    Make RecordToStderr (the Recorder subclass engaged by LLError::logToStderr())
    use fdopen() to create an LLFILE* targeting the duplicate file handle from
    Settings. Write output to that instead of to stderr so logToStderr() continues
    to provide output for the user instead of duplicating each line into the log
    file.
    07134aae
    History
    DRTVWR-476: Try to extend stderr redirection to Windows as well.
    Nat Goodspeed authored
    Make the LLError::Settings LLSingleton duplicate the file handle for stderr
    (usually 2) on construction. Make its destructor restore the original target
    for that file handle. Provide a getDupStderr() method to obtain the duplicate
    file handle.
    
    Move Settings declaration up to the top of the file so other code can
    reference it.
    
    Make RecordToFile (the Recorder subclass engaged by LLError::logToFile()),
    instead of duplicating stderr's file handle itself, capture the duplicate
    stderr file handle from Settings to revert stderr redirection on destruction.
    
    Make RecordToStderr (the Recorder subclass engaged by LLError::logToStderr())
    use fdopen() to create an LLFILE* targeting the duplicate file handle from
    Settings. Write output to that instead of to stderr so logToStderr() continues
    to provide output for the user instead of duplicating each line into the log
    file.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.