1212
1313using ITHit . FileSystem . Windows ;
1414using ITHit . FileSystem . Windows . Package ;
15+ using Windows . Storage . Search ;
1516
1617namespace ITHit . FileSystem . Samples . Common . Windows
1718{
@@ -103,11 +104,11 @@ public void PrintEnvironmentDescription()
103104 {
104105 log . Info ( $ "\n { "Sparse package location:" , indent } { sparsePackagePath } ") ;
105106 var cert = System . Security . Cryptography . X509Certificates . X509Certificate . CreateFromSignedFile ( sparsePackagePath ) ;
106- log . Info ( $ "\n { "Sparse package cert:" , indent } Subject: { cert . Subject } , Issued by: { cert . Issuer } ") ;
107+ log . Info ( $ "\n { "Sparse package cert:" , indent } Subject: { cert . Subject } , Issued by: { cert . Issuer } ") ;
107108 }
108109 else
109110 {
110- log . Info ( $ "\n { "Sparse package:" , indent } Not found") ;
111+ log . Info ( $ "\n { "Sparse package:" , indent } Not found") ;
111112 }
112113 }
113114
@@ -147,7 +148,13 @@ public async Task PrintEngineDescriptionAsync(EngineWindows engine)
147148 private async Task PrintIndexingStateAsync ( string path )
148149 {
149150 StorageFolder userFileSystemRootFolder = await StorageFolder . GetFolderFromPathAsync ( path ) ;
150- log . Info ( $ "\n { "Indexed state:" , indent } { await userFileSystemRootFolder . GetIndexedStateAsync ( ) } ") ;
151+ IndexedState indexedState = await userFileSystemRootFolder . GetIndexedStateAsync ( ) ;
152+ log . Info ( $ "\n { "Indexed state:" , indent } { indexedState } ") ;
153+
154+ if ( indexedState != IndexedState . FullyIndexed )
155+ {
156+ log . ErrorFormat ( $ "\n Indexing is disabled. Indexing must be enabled for { path } ") ;
157+ }
151158 }
152159
153160 public void LogMessage ( string message )
@@ -195,7 +202,7 @@ private void WriteLog(IEngine sender, EngineMessageEventArgs e, log4net.Core.Lev
195202 string sourcePath = e . SourcePath ? . FitString ( sourcePathWidth , 6 ) ;
196203 string targetPath = e . TargetPath ? . FitString ( sourcePathWidth , 6 ) ;
197204
198- string message = Format ( DateTimeOffset . Now . ToString ( "hh:mm:ss.fff" ) , process , priorityHint ? . ToString ( ) , fileId , "" , e . ComponentName , e . CallerLineNumber . ToString ( ) , e . CallerMemberName , e . CallerFilePath , e . Message , sourcePath , att , targetPath ) ;
205+ string message = Format ( DateTimeOffset . Now . ToString ( "hh:mm:ss.fff" ) , process , priorityHint ? . ToString ( ) , fileId , "" , e . ComponentName , e . CallerLineNumber . ToString ( ) , e . CallerMemberName , e . CallerFilePath , e . Message , sourcePath , att , targetPath ) ;
199206
200207 if ( level == log4net . Core . Level . Error )
201208 {
@@ -214,13 +221,13 @@ private void WriteLog(IEngine sender, EngineMessageEventArgs e, log4net.Core.Lev
214221 {
215222 log . Debug ( message ) ;
216223 }
217-
224+
218225 }
219226
220227 private static string Format ( string date , string process , string priorityHint , string fileId , string remoteStorageId , string componentName , string callerLineNumber , string callerMemberName , string callerFilePath , string message , string sourcePath , string attributes , string targetPath )
221228 {
222229 // {fileId,-18} | {remoteStorageId,-remoteStorageIdWidth}
223- return $ "{ Environment . NewLine } |{ date , - 12 } | { process , - 25 } | { priorityHint , - 5 } | { componentName , - 26 } | { callerLineNumber , 4 } | { message , - 45 } | { sourcePath , - sourcePathWidth } | { attributes , 10 } | { targetPath } ";
230+ return $ "{ Environment . NewLine } |{ date , - 12 } | { process , - 25 } | { priorityHint , - 5 } | { componentName , - 26 } | { callerLineNumber , 4 } | { message , - 45 } | { sourcePath , - sourcePathWidth } | { attributes , 10 } | { targetPath } ";
224231 }
225232
226233 /// <summary>
0 commit comments