VirtualBox

Changeset 628 in vbox


Ignore:
Timestamp:
Feb 5, 2007 11:59:58 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18257
Message:

Implement log flag usecrlf, which translates LF line ending to CR/LF.
Activate it by default for Windows builds, only for release log so far.
Also fixed a couple of typos in comments.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdm.h

    r597 r628  
    64176417/**
    64186418 * This function will notify all the devices and their
    6419  * attached drivers about the VM now being reset.
     6419 * attached drivers about the VM now being suspended.
    64206420 *
    64216421 * @param   pVM     VM Handle.
  • trunk/include/iprt/log.h

    r529 r628  
    279279    /** The logger instance is using buffered output. */
    280280    RTLOGFLAGS_BUFFERED         = 0x00000002,
     281    /** The logger instance expands LF to CR/LF. */
     282    RTLOGFLAGS_USECRLF          = 0x00000010,
    281283    /** Show relative timestamps with PREFIX_TSC and PREFIX_TS */
    282284    RTLOGFLAGS_REL_TS           = 0x00010000,
     
    12811283 * @param   pfnOutput   Output worker.
    12821284 *                      Called in two ways. Normally with a string an it's length.
    1283  *                      For termiation, it's called with NULL for string, 0 for length.
     1285 *                      For termination, it's called with NULL for string, 0 for length.
    12841286 * @param   pvArg       Argument to output worker.
    12851287 * @param   pszFormat   Format string.
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r606 r628  
    61886188        PRTLOGGER loggerRelease;
    61896189        static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES;
    6190         vrc = RTLogCreate(&loggerRelease, RTLOGFLAGS_PREFIX_TIME_PROG, "all",
     6190        RTUINT fFlags = RTLOGFLAGS_PREFIX_TIME_PROG;
     6191#ifdef __WIN__
     6192        fFlags |= RTLOGFLAGS_USECRLF;
     6193#endif /* __WIN__ */
     6194        vrc = RTLogCreate(&loggerRelease, fFlags, "all",
    61916195                          "VBOX_RELEASE_LOG", ELEMENTS(s_apszGroups), s_apszGroups,
    61926196                          RTLOGDEST_FILE, logFile.raw());
  • trunk/src/VBox/Runtime/log.cpp

    r408 r628  
    11091109            { "buffered",     sizeof("buffered"    ) - 1,   RTLOGFLAGS_BUFFERED,            false },
    11101110            { "unbuffered",   sizeof("unbuffered"  ) - 1,   RTLOGFLAGS_BUFFERED,            true  },
     1111            { "usecrlf",      sizeof("usecrlf"     ) - 1,   RTLOGFLAGS_USECRLF,             true },
     1112            { "uself",        sizeof("uself"       ) - 1,   RTLOGFLAGS_USECRLF,             false  },
    11111113            { "rel",          sizeof("rel"         ) - 1,   RTLOGFLAGS_REL_TS,              false },
    1112             { "abs",          sizeof("rel"         ) - 1,   RTLOGFLAGS_REL_TS,              true  },
     1114            { "abs",          sizeof("abs"         ) - 1,   RTLOGFLAGS_REL_TS,              true  },
    11131115            { "dec",          sizeof("dec"         ) - 1,   RTLOGFLAGS_DECIMAL_TS,          false },
    11141116            { "hex",          sizeof("hex"         ) - 1,   RTLOGFLAGS_DECIMAL_TS,          true  },
     
    20532055            if (pszNewLine)
    20542056            {
    2055                 pLogger->fPendingPrefix = true;
    2056                 cb = pszNewLine - pachChars + 1;
     2057                if (pLogger->fFlags & RTLOGFLAGS_USECRLF)
     2058                    cb = pszNewLine - pachChars;
     2059                else
     2060                {
     2061                    cb = pszNewLine - pachChars + 1;
     2062                    pLogger->fPendingPrefix = true;
     2063                }
    20572064            }
    20582065
     
    20642071            cbRet += cb;
    20652072            cbChars -= cb;
     2073
     2074            if (    pszNewLine
     2075                &&  pLogger->fFlags & RTLOGFLAGS_USECRLF
     2076                &&  pLogger->offScratch + 2 < sizeof(pLogger->achScratch))
     2077            {
     2078                memcpy(&pLogger->achScratch[pLogger->offScratch], "\r\n", 2);
     2079                pLogger->offScratch += 2;
     2080                cbRet++;
     2081                cbChars--;
     2082                cb++;
     2083                pLogger->fPendingPrefix = true;
     2084            }
    20662085
    20672086            /* done? */
  • trunk/src/VBox/Runtime/logformat.cpp

    r1 r628  
    5151 * @param   pfnOutput   Output worker.
    5252 *                      Called in two ways. Normally with a string an it's length.
    53  *                      For termiation, it's called with NULL for string, 0 for length.
     53 *                      For termination, it's called with NULL for string, 0 for length.
    5454 * @param   pvArg       Argument to output worker.
    5555 * @param   pszFormat   Format string.
  • trunk/src/VBox/Runtime/strformat.cpp

    r1 r628  
    291291 * @param   pfnOutput   Output worker.
    292292 *                      Called in two ways. Normally with a string an it's length.
    293  *                      For termiation, it's called with NULL for string, 0 for length.
     293 *                      For termination, it's called with NULL for string, 0 for length.
    294294 * @param   pvArgOutput Argument to the output worker.
    295295 * @param   pfnFormat   Custom format worker.
     
    818818 * @param   pfnOutput   Output worker.
    819819 *                      Called in two ways. Normally with a string an it's length.
    820  *                      For termiation, it's called with NULL for string, 0 for length.
     820 *                      For termination, it's called with NULL for string, 0 for length.
    821821 * @param   pvArgOutput Argument to the output worker.
    822822 * @param   pfnFormat   Custom format worker.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette