183 template<typename... argtypes> |
183 template<typename... argtypes> |
184 void print_to (const String& filename, const String& fmtstr, const argtypes&... args) |
184 void print_to (const String& filename, const String& fmtstr, const argtypes&... args) |
185 { |
185 { |
186 FILE* handle; |
186 FILE* handle; |
187 |
187 |
188 if ((handle = fopen (filename, "w+"))) |
188 if ((handle = fopen (filename, "a"))) |
189 { |
189 { |
190 print_to (handle, fmtstr, args...); |
190 print_to (handle, fmtstr, args...); |
191 fclose (handle); |
191 fclose (handle); |
192 } |
192 } |
193 } |
193 } |
194 |
194 |
195 // ------------------------------------------------------------------------------------------------- |
195 // ------------------------------------------------------------------------------------------------- |
196 // Prints the formatting result to stdout |
196 // Prints the formatting result to the console |
197 // |
197 // |
198 template<typename... argtypes> |
198 template<typename... argtypes> |
199 void print (const String& fmtstr, const argtypes&... args) |
199 void print (const String& fmtstr, const argtypes&... args) |
200 { |
200 { |
201 print_to (stdout, fmtstr, args...); |
201 print_to_console (format (fmtstr, args...); |
202 } |
202 } |