diff --git a/compiled_starters/cpp/src/Server.cpp b/compiled_starters/cpp/src/Server.cpp index 8510ded..fe12d64 100644 --- a/compiled_starters/cpp/src/Server.cpp +++ b/compiled_starters/cpp/src/Server.cpp @@ -16,7 +16,7 @@ int main(int argc, char* argv[]) { std::cerr << std::unitbuf; // You can use print statements as follows for debugging, they'll be visible when running tests. - std::cout << "Logs from your program will appear here" << std::endl; + std::cerr << "Logs from your program will appear here" << std::endl; if (argc != 3) { std::cerr << "Expected two arguments" << std::endl; diff --git a/compiled_starters/csharp/src/Program.cs b/compiled_starters/csharp/src/Program.cs index a973848..45ae00e 100644 --- a/compiled_starters/csharp/src/Program.cs +++ b/compiled_starters/csharp/src/Program.cs @@ -23,7 +23,7 @@ static bool MatchPattern(string inputLine, string pattern) string inputLine = Console.In.ReadToEnd(); // You can use print statements as follows for debugging, they'll be visible when running tests. -Console.WriteLine("Logs from your program will appear here!"); +Console.Error.WriteLine("Logs from your program will appear here!"); // Uncomment this block to pass the first stage // diff --git a/compiled_starters/gleam/src/main.gleam b/compiled_starters/gleam/src/main.gleam index d4b93cc..9d37833 100644 --- a/compiled_starters/gleam/src/main.gleam +++ b/compiled_starters/gleam/src/main.gleam @@ -5,7 +5,7 @@ import gleam/string pub fn main() { // You can use print statements as follows for debugging, they'll be visible when running tests. - io.println("Logs from your program will appear here!") + io.print_error("Logs from your program will appear here!") let args = argv.load().arguments let assert Ok(input_line) = erlang.get_line("") diff --git a/compiled_starters/go/cmd/mygrep/main.go b/compiled_starters/go/cmd/mygrep/main.go index caaeeb0..99df5d9 100644 --- a/compiled_starters/go/cmd/mygrep/main.go +++ b/compiled_starters/go/cmd/mygrep/main.go @@ -47,7 +47,7 @@ func matchLine(line []byte, pattern string) (bool, error) { var ok bool // You can use print statements as follows for debugging, they'll be visible when running tests. - fmt.Println("Logs from your program will appear here!") + fmt.Fprintln(os.Stderr, "Logs from your program will appear here!") // Uncomment this to pass the first stage // ok = bytes.ContainsAny(line, pattern) diff --git a/compiled_starters/haskell/app/Main.hs b/compiled_starters/haskell/app/Main.hs index 1c1dd8f..64ef174 100644 --- a/compiled_starters/haskell/app/Main.hs +++ b/compiled_starters/haskell/app/Main.hs @@ -16,7 +16,7 @@ main = do input_line <- getLine -- You can use print statements as follows for debugging, they'll be visible when running tests. - putStrLn "Logs from your program will appear here" + hPutStrLn stderr "Logs from your program will appear here" -- Uncomment this block to pass stage 1 -- if head args /= "-E" diff --git a/compiled_starters/javascript/app/main.js b/compiled_starters/javascript/app/main.js index 80934cf..ba2e737 100644 --- a/compiled_starters/javascript/app/main.js +++ b/compiled_starters/javascript/app/main.js @@ -16,7 +16,7 @@ function main() { } // You can use print statements as follows for debugging, they'll be visible when running tests. - console.log("Logs from your program will appear here"); + console.error("Logs from your program will appear here"); // Uncomment this block to pass the first stage // if (matchPattern(inputLine, pattern)) { diff --git a/compiled_starters/python/app/main.py b/compiled_starters/python/app/main.py index 18b06a1..3c5d3de 100644 --- a/compiled_starters/python/app/main.py +++ b/compiled_starters/python/app/main.py @@ -20,7 +20,7 @@ def main(): exit(1) # You can use print statements as follows for debugging, they'll be visible when running tests. - print("Logs from your program will appear here!") + print("Logs from your program will appear here!", file=sys.stderr) # Uncomment this block to pass the first stage # if match_pattern(input_line, pattern): diff --git a/compiled_starters/ruby/app/main.rb b/compiled_starters/ruby/app/main.rb index 371eb53..8813b4e 100644 --- a/compiled_starters/ruby/app/main.rb +++ b/compiled_starters/ruby/app/main.rb @@ -16,7 +16,7 @@ def main end # You can use print statements as follows for debugging, they'll be visible when running tests. - puts "Logs from your program will appear here" + warn "Logs from your program will appear here" # Uncomment this block to pass the first stage # if match_pattern(input_line, pattern) diff --git a/compiled_starters/rust/src/main.rs b/compiled_starters/rust/src/main.rs index 44cd655..76fa3f0 100644 --- a/compiled_starters/rust/src/main.rs +++ b/compiled_starters/rust/src/main.rs @@ -13,7 +13,7 @@ fn match_pattern(input_line: &str, pattern: &str) -> bool { // Usage: echo | your_program.sh -E fn main() { // You can use print statements as follows for debugging, they'll be visible when running tests. - println!("Logs from your program will appear here!"); + eprintln!("Logs from your program will appear here!"); if env::args().nth(1).unwrap() != "-E" { println!("Expected first argument to be '-E'"); diff --git a/compiled_starters/typescript/app/main.ts b/compiled_starters/typescript/app/main.ts index ab6bb3b..b7c9c0d 100644 --- a/compiled_starters/typescript/app/main.ts +++ b/compiled_starters/typescript/app/main.ts @@ -17,7 +17,7 @@ if (args[2] !== "-E") { } // You can use print statements as follows for debugging, they'll be visible when running tests. -console.log("Logs from your program will appear here!"); +console.error("Logs from your program will appear here!"); // Uncomment this block to pass the first stage // if (matchPattern(inputLine, pattern)) { diff --git a/solutions/cpp/01-cq2/diff/src/Server.cpp.diff b/solutions/cpp/01-cq2/diff/src/Server.cpp.diff index 17dc2de..07b557f 100644 --- a/solutions/cpp/01-cq2/diff/src/Server.cpp.diff +++ b/solutions/cpp/01-cq2/diff/src/Server.cpp.diff @@ -17,7 +17,7 @@ std::cerr << std::unitbuf; - // You can use print statements as follows for debugging, they'll be visible when running tests. -- std::cout << "Logs from your program will appear here" << std::endl; +- std::cerr << "Logs from your program will appear here" << std::endl; - if (argc != 3) { std::cerr << "Expected two arguments" << std::endl; diff --git a/solutions/csharp/01-cq2/diff/src/Program.cs.diff b/solutions/csharp/01-cq2/diff/src/Program.cs.diff index 34d9983..d5fb90d 100644 --- a/solutions/csharp/01-cq2/diff/src/Program.cs.diff +++ b/solutions/csharp/01-cq2/diff/src/Program.cs.diff @@ -24,7 +24,7 @@ string inputLine = Console.In.ReadToEnd(); -// You can use print statements as follows for debugging, they'll be visible when running tests. --Console.WriteLine("Logs from your program will appear here!"); +-Console.Error.WriteLine("Logs from your program will appear here!"); - -// Uncomment this block to pass the first stage -// diff --git a/solutions/gleam/01-cq2/diff/src/main.gleam.diff b/solutions/gleam/01-cq2/diff/src/main.gleam.diff index 9ae8877..b6873c7 100644 --- a/solutions/gleam/01-cq2/diff/src/main.gleam.diff +++ b/solutions/gleam/01-cq2/diff/src/main.gleam.diff @@ -6,7 +6,7 @@ pub fn main() { - // You can use print statements as follows for debugging, they'll be visible when running tests. -- io.println("Logs from your program will appear here!") +- io.print_error("Logs from your program will appear here!") - let args = argv.load().arguments let assert Ok(input_line) = erlang.get_line("") diff --git a/solutions/go/01-cq2/diff/cmd/mygrep/main.go.diff b/solutions/go/01-cq2/diff/cmd/mygrep/main.go.diff index 6739228..97b2c6b 100644 --- a/solutions/go/01-cq2/diff/cmd/mygrep/main.go.diff +++ b/solutions/go/01-cq2/diff/cmd/mygrep/main.go.diff @@ -25,7 +25,7 @@ var ok bool - // You can use print statements as follows for debugging, they'll be visible when running tests. -- fmt.Println("Logs from your program will appear here!") +- fmt.Fprintln(os.Stderr, "Logs from your program will appear here!") - - // Uncomment this to pass the first stage - // ok = bytes.ContainsAny(line, pattern) diff --git a/solutions/haskell/01-cq2/diff/app/Main.hs.diff b/solutions/haskell/01-cq2/diff/app/Main.hs.diff index 50c1edf..eab09c8 100644 --- a/solutions/haskell/01-cq2/diff/app/Main.hs.diff +++ b/solutions/haskell/01-cq2/diff/app/Main.hs.diff @@ -17,7 +17,7 @@ input_line <- getLine - -- You can use print statements as follows for debugging, they'll be visible when running tests. -- putStrLn "Logs from your program will appear here" +- hPutStrLn stderr "Logs from your program will appear here" - - -- Uncomment this block to pass stage 1 - -- if head args /= "-E" diff --git a/solutions/javascript/01-cq2/diff/app/main.js.diff b/solutions/javascript/01-cq2/diff/app/main.js.diff index 652bdaa..1a36c3b 100644 --- a/solutions/javascript/01-cq2/diff/app/main.js.diff +++ b/solutions/javascript/01-cq2/diff/app/main.js.diff @@ -17,7 +17,7 @@ } - // You can use print statements as follows for debugging, they'll be visible when running tests. -- console.log("Logs from your program will appear here"); +- console.error("Logs from your program will appear here"); - - // Uncomment this block to pass the first stage - // if (matchPattern(inputLine, pattern)) { diff --git a/solutions/python/01-cq2/diff/app/main.py.diff b/solutions/python/01-cq2/diff/app/main.py.diff index dbb343b..4cdbb66 100644 --- a/solutions/python/01-cq2/diff/app/main.py.diff +++ b/solutions/python/01-cq2/diff/app/main.py.diff @@ -21,7 +21,7 @@ exit(1) - # You can use print statements as follows for debugging, they'll be visible when running tests. -- print("Logs from your program will appear here!") +- print("Logs from your program will appear here!", file=sys.stderr) - - # Uncomment this block to pass the first stage - # if match_pattern(input_line, pattern): diff --git a/solutions/ruby/01-cq2/diff/app/main.rb.diff b/solutions/ruby/01-cq2/diff/app/main.rb.diff index 6543509..7aad2c8 100644 --- a/solutions/ruby/01-cq2/diff/app/main.rb.diff +++ b/solutions/ruby/01-cq2/diff/app/main.rb.diff @@ -17,7 +17,7 @@ end - # You can use print statements as follows for debugging, they'll be visible when running tests. -- puts "Logs from your program will appear here" +- warn "Logs from your program will appear here" - - # Uncomment this block to pass the first stage - # if match_pattern(input_line, pattern) diff --git a/solutions/rust/01-cq2/diff/src/main.rs.diff b/solutions/rust/01-cq2/diff/src/main.rs.diff index fa01b7a..8d8442a 100644 --- a/solutions/rust/01-cq2/diff/src/main.rs.diff +++ b/solutions/rust/01-cq2/diff/src/main.rs.diff @@ -14,7 +14,7 @@ // Usage: echo | your_program.sh -E fn main() { - // You can use print statements as follows for debugging, they'll be visible when running tests. -- println!("Logs from your program will appear here!"); +- eprintln!("Logs from your program will appear here!"); - if env::args().nth(1).unwrap() != "-E" { println!("Expected first argument to be '-E'"); diff --git a/solutions/typescript/01-cq2/diff/app/main.ts.diff b/solutions/typescript/01-cq2/diff/app/main.ts.diff index 9604b8e..46c4eed 100644 --- a/solutions/typescript/01-cq2/diff/app/main.ts.diff +++ b/solutions/typescript/01-cq2/diff/app/main.ts.diff @@ -18,7 +18,7 @@ } -// You can use print statements as follows for debugging, they'll be visible when running tests. --console.log("Logs from your program will appear here!"); +-console.error("Logs from your program will appear here!"); - -// Uncomment this block to pass the first stage -// if (matchPattern(inputLine, pattern)) { diff --git a/starter_templates/cpp/code/src/Server.cpp b/starter_templates/cpp/code/src/Server.cpp index 8510ded..fe12d64 100644 --- a/starter_templates/cpp/code/src/Server.cpp +++ b/starter_templates/cpp/code/src/Server.cpp @@ -16,7 +16,7 @@ int main(int argc, char* argv[]) { std::cerr << std::unitbuf; // You can use print statements as follows for debugging, they'll be visible when running tests. - std::cout << "Logs from your program will appear here" << std::endl; + std::cerr << "Logs from your program will appear here" << std::endl; if (argc != 3) { std::cerr << "Expected two arguments" << std::endl; diff --git a/starter_templates/csharp/code/src/Program.cs b/starter_templates/csharp/code/src/Program.cs index a973848..45ae00e 100644 --- a/starter_templates/csharp/code/src/Program.cs +++ b/starter_templates/csharp/code/src/Program.cs @@ -23,7 +23,7 @@ static bool MatchPattern(string inputLine, string pattern) string inputLine = Console.In.ReadToEnd(); // You can use print statements as follows for debugging, they'll be visible when running tests. -Console.WriteLine("Logs from your program will appear here!"); +Console.Error.WriteLine("Logs from your program will appear here!"); // Uncomment this block to pass the first stage // diff --git a/starter_templates/gleam/code/src/main.gleam b/starter_templates/gleam/code/src/main.gleam index d4b93cc..9d37833 100644 --- a/starter_templates/gleam/code/src/main.gleam +++ b/starter_templates/gleam/code/src/main.gleam @@ -5,7 +5,7 @@ import gleam/string pub fn main() { // You can use print statements as follows for debugging, they'll be visible when running tests. - io.println("Logs from your program will appear here!") + io.print_error("Logs from your program will appear here!") let args = argv.load().arguments let assert Ok(input_line) = erlang.get_line("") diff --git a/starter_templates/go/code/cmd/mygrep/main.go b/starter_templates/go/code/cmd/mygrep/main.go index caaeeb0..99df5d9 100644 --- a/starter_templates/go/code/cmd/mygrep/main.go +++ b/starter_templates/go/code/cmd/mygrep/main.go @@ -47,7 +47,7 @@ func matchLine(line []byte, pattern string) (bool, error) { var ok bool // You can use print statements as follows for debugging, they'll be visible when running tests. - fmt.Println("Logs from your program will appear here!") + fmt.Fprintln(os.Stderr, "Logs from your program will appear here!") // Uncomment this to pass the first stage // ok = bytes.ContainsAny(line, pattern) diff --git a/starter_templates/haskell/code/app/Main.hs b/starter_templates/haskell/code/app/Main.hs index 1c1dd8f..64ef174 100644 --- a/starter_templates/haskell/code/app/Main.hs +++ b/starter_templates/haskell/code/app/Main.hs @@ -16,7 +16,7 @@ main = do input_line <- getLine -- You can use print statements as follows for debugging, they'll be visible when running tests. - putStrLn "Logs from your program will appear here" + hPutStrLn stderr "Logs from your program will appear here" -- Uncomment this block to pass stage 1 -- if head args /= "-E" diff --git a/starter_templates/javascript/code/app/main.js b/starter_templates/javascript/code/app/main.js index 80934cf..ba2e737 100644 --- a/starter_templates/javascript/code/app/main.js +++ b/starter_templates/javascript/code/app/main.js @@ -16,7 +16,7 @@ function main() { } // You can use print statements as follows for debugging, they'll be visible when running tests. - console.log("Logs from your program will appear here"); + console.error("Logs from your program will appear here"); // Uncomment this block to pass the first stage // if (matchPattern(inputLine, pattern)) { diff --git a/starter_templates/python/code/app/main.py b/starter_templates/python/code/app/main.py index 18b06a1..3c5d3de 100644 --- a/starter_templates/python/code/app/main.py +++ b/starter_templates/python/code/app/main.py @@ -20,7 +20,7 @@ def main(): exit(1) # You can use print statements as follows for debugging, they'll be visible when running tests. - print("Logs from your program will appear here!") + print("Logs from your program will appear here!", file=sys.stderr) # Uncomment this block to pass the first stage # if match_pattern(input_line, pattern): diff --git a/starter_templates/ruby/code/app/main.rb b/starter_templates/ruby/code/app/main.rb index 371eb53..8813b4e 100644 --- a/starter_templates/ruby/code/app/main.rb +++ b/starter_templates/ruby/code/app/main.rb @@ -16,7 +16,7 @@ def main end # You can use print statements as follows for debugging, they'll be visible when running tests. - puts "Logs from your program will appear here" + warn "Logs from your program will appear here" # Uncomment this block to pass the first stage # if match_pattern(input_line, pattern) diff --git a/starter_templates/rust/code/src/main.rs b/starter_templates/rust/code/src/main.rs index 44cd655..76fa3f0 100644 --- a/starter_templates/rust/code/src/main.rs +++ b/starter_templates/rust/code/src/main.rs @@ -13,7 +13,7 @@ fn match_pattern(input_line: &str, pattern: &str) -> bool { // Usage: echo | your_program.sh -E fn main() { // You can use print statements as follows for debugging, they'll be visible when running tests. - println!("Logs from your program will appear here!"); + eprintln!("Logs from your program will appear here!"); if env::args().nth(1).unwrap() != "-E" { println!("Expected first argument to be '-E'"); diff --git a/starter_templates/typescript/code/app/main.ts b/starter_templates/typescript/code/app/main.ts index ab6bb3b..b7c9c0d 100644 --- a/starter_templates/typescript/code/app/main.ts +++ b/starter_templates/typescript/code/app/main.ts @@ -17,7 +17,7 @@ if (args[2] !== "-E") { } // You can use print statements as follows for debugging, they'll be visible when running tests. -console.log("Logs from your program will appear here!"); +console.error("Logs from your program will appear here!"); // Uncomment this block to pass the first stage // if (matchPattern(inputLine, pattern)) {