@@ -14,14 +14,6 @@ namespace TE.FileWatcher.Configuration.Actions
1414 /// </summary>
1515 public class Action : RunnableBase
1616 {
17- // The placeholders for the destination path
18- //private Dictionary<string, string> _destinationPlaceholders
19- // = new Dictionary<string, string>();
20-
21- // The placeholders for the source path
22- //private Dictionary<string, string> _sourcePlaceholders
23- // = new Dictionary<string, string>();
24-
2517 /// <summary>
2618 /// The type of action to perform.
2719 /// </summary>
@@ -118,7 +110,9 @@ public override void Run(string watchPath, string fullPath, TriggerType trigger)
118110 {
119111 if ( string . IsNullOrWhiteSpace ( destination ) )
120112 {
121- Logger . WriteLine ( $ "The file '{ source } ' could not be copied because the destination file was not specified.") ;
113+ Logger . WriteLine (
114+ $ "The file '{ source } ' could not be copied because the destination file was not specified.",
115+ LogLevel . ERROR ) ;
122116 return ;
123117 }
124118
@@ -127,7 +121,9 @@ public override void Run(string watchPath, string fullPath, TriggerType trigger)
127121 }
128122 else
129123 {
130- Logger . WriteLine ( $ "The file '{ source } ' could not be copied because the path was not valid, the file doesn't exists, or it was in use.") ;
124+ Logger . WriteLine (
125+ $ "The file '{ source } ' could not be copied because the path was not valid, the file doesn't exists, or it was in use.",
126+ LogLevel . ERROR ) ;
131127 }
132128 break ;
133129 case ActionType . Move :
@@ -144,7 +140,9 @@ public override void Run(string watchPath, string fullPath, TriggerType trigger)
144140 }
145141 else
146142 {
147- Logger . WriteLine ( $ "The file '{ source } ' could not be moved because the path was not valid, the file doesn't exists, or it was in use.") ;
143+ Logger . WriteLine (
144+ $ "The file '{ source } ' could not be moved because the path was not valid, the file doesn't exists, or it was in use.",
145+ LogLevel . ERROR ) ;
148146 }
149147 break ;
150148 case ActionType . Delete :
@@ -155,15 +153,17 @@ public override void Run(string watchPath, string fullPath, TriggerType trigger)
155153 }
156154 else
157155 {
158- Logger . WriteLine ( $ "The file '{ source } ' could not be deleted because the path was not valid, the file doesn't exists, or it was in use.") ;
156+ Logger . WriteLine (
157+ $ "The file '{ source } ' could not be deleted because the path was not valid, the file doesn't exists, or it was in use.",
158+ LogLevel . ERROR ) ;
159159 }
160160 break ;
161161 }
162162 }
163163 catch ( Exception ex )
164164 {
165165 string message = ( ex . InnerException == null ) ? ex . Message : ex . InnerException . Message ;
166- Logger . WriteLine ( $ "Could not { Type . ToString ( ) . ToLower ( ) } file { source } . Reason: { message } ") ;
166+ Logger . WriteLine ( $ "Could not { Type . ToString ( ) . ToLower ( ) } file { source } . Reason: { message } ", LogLevel . ERROR ) ;
167167 return ;
168168 }
169169 }
0 commit comments