mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:52:45 +00:00 
			
		
		
		
	AK: Don't add newline for outf/dbgf/warnf.
In the future all (normal) output should be written by any of the
following functions:
    out    (currently called new_out)
    outln
    dbg    (currently called new_dbg)
    dbgln
    warn   (currently called new_warn)
    warnln
However, there are still a ton of uses of the old out/warn/dbg in the
code base so the new functions are called new_out/new_warn/new_dbg. I am
going to rename them as soon as all the other usages are gone (this
might take a while.)
I also added raw_out/raw_dbg/raw_warn which don't do any escaping,
this should be useful if no formatting is required and if the input
contains tons of curly braces. (I am not entirely sure if this function
will stay, but I am adding it for now.)
			
			
This commit is contained in:
		
							parent
							
								
									4237089a21
								
							
						
					
					
						commit
						d5ffb51a83
					
				
					 16 changed files with 202 additions and 96 deletions
				
			
		
							
								
								
									
										43
									
								
								AK/Format.h
									
										
									
									
									
								
							
							
						
						
									
										43
									
								
								AK/Format.h
									
										
									
									
									
								
							|  | @ -299,4 +299,47 @@ struct Formatter<bool> : StandardFormatter { | |||
| void vformat(StringBuilder& builder, StringView fmtstr, TypeErasedFormatParams); | ||||
| void vformat(const LogStream& stream, StringView fmtstr, TypeErasedFormatParams); | ||||
| 
 | ||||
| #ifndef KERNEL | ||||
| void vout(StringView fmtstr, TypeErasedFormatParams, bool newline = false); | ||||
| void raw_out(StringView string); | ||||
| 
 | ||||
| // FIXME: Rename this function to 'out' when that name becomes avaliable.
 | ||||
| template<typename... Parameters> | ||||
| void new_out(StringView fmtstr, const Parameters&... parameters) { vout(fmtstr, VariadicFormatParams { parameters... }); } | ||||
| template<typename... Parameters> | ||||
| void outln(StringView fmtstr, const Parameters&... parameters) { vout(fmtstr, VariadicFormatParams { parameters... }, true); } | ||||
| 
 | ||||
| void vwarn(StringView fmtstr, TypeErasedFormatParams, bool newline = false); | ||||
| void raw_warn(StringView string); | ||||
| 
 | ||||
| // FIXME: Rename this function to 'warn' when that name becomes avaliable.
 | ||||
| template<typename... Parameters> | ||||
| void new_warn(StringView fmtstr, const Parameters&... parameters) { vwarn(fmtstr, VariadicFormatParams { parameters... }); } | ||||
| template<typename... Parameters> | ||||
| void warnln(StringView fmtstr, const Parameters&... parameters) { vwarn(fmtstr, VariadicFormatParams { parameters... }, true); } | ||||
| #endif | ||||
| 
 | ||||
| void vdbg(StringView fmtstr, TypeErasedFormatParams, bool newline = false); | ||||
| void raw_dbg(StringView string); | ||||
| 
 | ||||
| // FIXME: Rename this function to 'dbg' when that name becomes avaliable.
 | ||||
| template<typename... Parameters> | ||||
| void new_dbg(StringView fmtstr, const Parameters&... parameters) { vdbg(fmtstr, VariadicFormatParams { parameters... }); } | ||||
| template<typename... Parameters> | ||||
| void dbgln(StringView fmtstr, const Parameters&... parameters) { vdbg(fmtstr, VariadicFormatParams { parameters... }, true); } | ||||
| 
 | ||||
| } // namespace AK
 | ||||
| 
 | ||||
| #ifndef KERNEL | ||||
| using AK::new_out; | ||||
| using AK::outln; | ||||
| using AK::raw_out; | ||||
| 
 | ||||
| using AK::new_warn; | ||||
| using AK::raw_warn; | ||||
| using AK::warnln; | ||||
| #endif | ||||
| 
 | ||||
| using AK::dbgln; | ||||
| using AK::new_dbg; | ||||
| using AK::raw_dbg; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 asynts
						asynts