@@ -37,6 +37,7 @@ internal class CompilerService
3737 private string compilerBasicArguments = "-unsafe true --setting:Force true -ms true" ;
3838 private static Regex fileErrorRegex = new Regex ( @"^\[(?'Severity'\S+)\]\[(?'Code'\S+)\]\[(?'File'\S+)\] (?'Message'.+)$" , RegexOptions . Compiled ) ;
3939 public bool Installed => File . Exists ( filePath ) ;
40+ private float startTime ;
4041
4142 public CompilerService ( Extension extension )
4243 {
@@ -127,10 +128,10 @@ private bool Start()
127128 }
128129
129130 Stop ( false , "starting new process" ) ;
130-
131- string args = compilerBasicArguments + $ " --parent { Process . GetCurrentProcess ( ) . Id } -l:file compiler_{ DateTime . Now : yyyy-MM-dd} .log";
131+ startTime = Interface . Oxide . Now ;
132+ string args = compilerBasicArguments + $ " --parent { Process . GetCurrentProcess ( ) . Id } -l:file \" { Path . Combine ( Interface . Oxide . LogDirectory , $ "oxide. compiler_{ DateTime . Now : yyyy-MM-dd} .log" ) } \" ";
132133#if DEBUG
133- args += " -v Debug " ;
134+ args += " -v debug " ;
134135#endif
135136 Log ( LogType . Info , $ "Starting compiler with parameters: { args } ") ;
136137 try
@@ -360,8 +361,24 @@ private void OnMessage(ObjectStreamConnection<CompilerMessage, CompilerMessage>
360361 break ;
361362
362363 case CompilerMessageType . Ready :
363- Log ( LogType . Info , "Compiler sent the ready signal, starting compilations. . ." ) ;
364+ string logMessage = $ "Ready signal received from compiler (Startup took: { Math . Round ( ( Interface . Oxide . Now - startTime ) * 1000f ) } ms)";
365+ switch ( messageQueue . Count )
366+ {
367+ case 0 :
368+ Log ( LogType . Info , logMessage ) ;
369+ break ;
370+
371+ case 1 :
372+ Log ( LogType . Info , logMessage + ", sending compilation. . ." ) ;
373+ break ;
374+
375+ default :
376+ Log ( LogType . Info , logMessage + $ ", sending { messageQueue . Count } compilations. . .") ;
377+ break ;
378+ }
379+
364380 connection . PushMessage ( message ) ;
381+
365382 if ( ! ready )
366383 {
367384 ready = true ;
@@ -492,6 +509,9 @@ private void EnqueueCompilation(Compilation compilation)
492509 OutputFile = compilation . name ,
493510 SourceFiles = sourceFiles . ToArray ( ) ,
494511 ReferenceFiles = compilation . references . Values . ToArray ( )
512+ #if DEBUG
513+ , Debug = true
514+ #endif
495515 } ;
496516
497517 CompilerMessage message = new CompilerMessage { Id = compilation . id , Data = data , Type = CompilerMessageType . Compile } ;
0 commit comments