diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 74c58b532d..244796733b 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -451,7 +451,8 @@ var runCommandOptions = { ...inspectOptions, 'no-release-check': { type: Boolean }, production: { type: Boolean }, - 'raw-logs': { type: Boolean }, + 'raw-logs': { type: Boolean, default: true }, + timestamps: { type: Boolean, default: false }, // opposite of --raw-logs settings: { type: String, short: "s" }, verbose: { type: Boolean, short: "v" }, // With --once, meteor does not re-run the project if it crashes @@ -535,10 +536,7 @@ async function doRunCommand(options) { ); } - if (options['raw-logs']) { - runLog.setRawLogs(true); - } - + runLog.setRawLogs(options['raw-logs'] && !options.timestamps); let webArchs = projectContext.platformList.getWebArchs(); if (! _.isEmpty(runTargets) || @@ -2141,7 +2139,8 @@ testCommandOptions = { // like progress bars and spinners are unimportant. headless: { type: Boolean }, verbose: { type: Boolean, short: "v" }, - 'raw-logs': { type: Boolean }, + 'raw-logs': { type: Boolean, default: true }, + timestamps: { type: Boolean, default: false }, // opposite of --raw-logs // Undocumented. See #Once once: { type: Boolean }, @@ -2276,9 +2275,8 @@ async function doTestCommand(options) { serverArchitectures.push(DEPLOY_ARCH); } - if (options['raw-logs']) { - runLog.setRawLogs(true); - } + runLog.setRawLogs(options['raw-logs'] && !options.timestamps); + var includePackages = []; if (options['extra-packages']) { diff --git a/tools/cli/help.txt b/tools/cli/help.txt index a329a8bcf8..e560cd2716 100644 --- a/tools/cli/help.txt +++ b/tools/cli/help.txt @@ -90,7 +90,8 @@ Options: Meteor app source code as by default the port is generated using the id inside .meteor/.id file. --production Simulate production mode. Minify and bundle CSS and JS files. - --raw-logs Run without parsing logs from stdout and stderr. + --raw-logs Run without parsing logs from stdout and stderr (default: true). + --timestamps Run with timestamps in logs, the same as passing `--raw-logs=false`. --settings, -s Set optional data for Meteor.settings on the server. --release Specify the release of Meteor to use. --verbose Print all output from builds logs. @@ -749,7 +750,9 @@ Options: important when multiple Cordova apps are build from the same Meteor app source code as by default the port is generated using the id inside .meteor/.id file. - --raw-logs Run without parsing logs from stdout and stderr. + --raw-logs Run without parsing logs from stdout and stderr (default: true). + --timestamps Run with timestamps in logs, the same as passing `--raw-logs=false`. + --settings, -s Set optional data for Meteor.settings on the server --ios, Run tests in an emulator or on a mobile device. All of diff --git a/tools/tests/run.js b/tools/tests/run.js index 719ce0767d..0093676d50 100644 --- a/tools/tests/run.js +++ b/tools/tests/run.js @@ -403,7 +403,7 @@ selftest.define("run and SIGKILL parent process", ["yet-unsolved-windows-failure await s.createApp("myapp", "app-prints-pid"); s.cd("myapp"); - run = s.run(); + run = s.run("run", "--timestamps"); run.waitSecs(30); var match = await run.match(/My pid is (\d+)/); var childPid; @@ -434,7 +434,8 @@ selftest.define("run and SIGKILL parent process", ["yet-unsolved-windows-failure // Test that passing a bad pid in $METEOR_PARENT_PID logs an error and exits // immediately. s.set("METEOR_BAD_PARENT_PID_FOR_TEST", "t"); - run = s.run(); + run = s.run("run", "--timestamps"); + run.waitSecs(120); await run.match("must be a valid process ID"); await run.match("Your application is crashing"); diff --git a/v3-docs/docs/cli/index.md b/v3-docs/docs/cli/index.md index c3c31796c4..626742b91f 100644 --- a/v3-docs/docs/cli/index.md +++ b/v3-docs/docs/cli/index.md @@ -53,7 +53,8 @@ This is the default command. Simply running `meteor` is the same as `meteor run` | `--mobile-server ` | Location where mobile builds connect (defaults to local IP and port). Can include URL scheme (e.g., https://example.com:443) | | `--cordova-server-port ` | Local port where Cordova will serve content | | `--production` | Simulate production mode. Minify and bundle CSS and JS files | -| `--raw-logs` | Run without parsing logs from stdout and stderr | +| `--raw-logs` | Run without parsing logs from stdout and stderr (default: true) | +| `--timestamps` | Run with timestamps in logs, the same as passing `--raw-logs=false`. | | `--settings`, `-s ` | Set optional data for Meteor.settings on the server | | `--release ` | Specify the release of Meteor to use | | `--verbose` | Print all output from builds logs | @@ -247,10 +248,10 @@ If you run `meteor create` without arguments, Meteor will launch an interactive Typescript # To create an app using TypeScript and React Vue # To create a basic Vue3-based app Svelte # To create a basic Svelte app - Tailwind # To create an app using React and Tailwind - Chakra-ui # To create an app Chakra UI and React - Solid # To create a basic Solid app - Apollo # To create a basic Apollo + React app + Tailwind # To create an app using React and Tailwind + Chakra-ui # To create an app Chakra UI and React + Solid # To create a basic Solid app + Apollo # To create a basic Apollo + React app Bare # To create an empty app ``` ::: @@ -361,7 +362,7 @@ To learn more about the recommended file structure for Meteor apps, check the [M ## meteor generate {meteorgenerate} -``meteor generate`` is a command to generate boilerplate for your current project. `meteor generate` receives a name as a parameter, and generates files containing code to create a [Collection](https://docs.meteor.com/api/collections.html) with that name, [Methods](https://docs.meteor.com/api/meteor.html#methods) to perform basic CRUD operations on that Collection, and a [Subscription](https://docs.meteor.com/api/meteor.html#Meteor-publish) to read its data with reactivity from the client. +``meteor generate`` is a command to generate boilerplate for your current project. `meteor generate` receives a name as a parameter, and generates files containing code to create a [Collection](https://docs.meteor.com/api/collections.html) with that name, [Methods](https://docs.meteor.com/api/meteor.html#methods) to perform basic CRUD operations on that Collection, and a [Subscription](https://docs.meteor.com/api/meteor.html#Meteor-publish) to read its data with reactivity from the client. If you run ``meteor generate`` without arguments, it will ask you for a name, and name the auto-generated Collection accordingly. It will also ask if you do want Methods for your API and Publications to be generated as well.