1818use OCP \Files \Events \Node \NodeWrittenEvent ;
1919use OCP \Files \InvalidPathException ;
2020use OCP \Files \NotFoundException ;
21+ use OCP \Server ;
2122use Psr \Log \LoggerInterface ;
2223
2324/**
@@ -41,7 +42,7 @@ public function read(BeforeNodeReadEvent $event): void {
4142 'path ' => mb_substr ($ node ->getInternalPath (), 5 ),
4243 ];
4344 } catch (InvalidPathException |NotFoundException $ e ) {
44- \ OCP \ Server::get (LoggerInterface::class)->error (
45+ Server::get (LoggerInterface::class)->error (
4546 'Exception thrown in file read: ' . $ e ->getMessage (), ['app ' => 'admin_audit ' , 'exception ' => $ e ]
4647 );
4748 return ;
@@ -63,7 +64,7 @@ public function beforeRename(BeforeNodeRenamedEvent $event): void {
6364 $ source = $ event ->getSource ();
6465 $ this ->renamedNodes [$ source ->getId ()] = $ source ;
6566 } catch (InvalidPathException |NotFoundException $ e ) {
66- \ OCP \ Server::get (LoggerInterface::class)->error (
67+ Server::get (LoggerInterface::class)->error (
6768 'Exception thrown in file rename: ' . $ e ->getMessage (), ['app ' => 'admin_audit ' , 'exception ' => $ e ]
6869 );
6970 return ;
@@ -85,7 +86,7 @@ public function afterRename(NodeRenamedEvent $event): void {
8586 'newpath ' => mb_substr ($ target ->getInternalPath (), 5 ),
8687 ];
8788 } catch (InvalidPathException |NotFoundException $ e ) {
88- \ OCP \ Server::get (LoggerInterface::class)->error (
89+ Server::get (LoggerInterface::class)->error (
8990 'Exception thrown in file rename: ' . $ e ->getMessage (), ['app ' => 'admin_audit ' , 'exception ' => $ e ]
9091 );
9192 return ;
@@ -111,7 +112,7 @@ public function create(NodeCreatedEvent $event): void {
111112 'path ' => mb_substr ($ event ->getNode ()->getInternalPath (), 5 ),
112113 ];
113114 } catch (InvalidPathException |NotFoundException $ e ) {
114- \ OCP \ Server::get (LoggerInterface::class)->error (
115+ Server::get (LoggerInterface::class)->error (
115116 'Exception thrown in file create: ' . $ e ->getMessage (), ['app ' => 'admin_audit ' , 'exception ' => $ e ]
116117 );
117118 return ;
@@ -140,7 +141,7 @@ public function copy(NodeCopiedEvent $event): void {
140141 'newpath ' => mb_substr ($ event ->getTarget ()->getInternalPath (), 5 ),
141142 ];
142143 } catch (InvalidPathException |NotFoundException $ e ) {
143- \ OCP \ Server::get (LoggerInterface::class)->error (
144+ Server::get (LoggerInterface::class)->error (
144145 'Exception thrown in file copy: ' . $ e ->getMessage (), ['app ' => 'admin_audit ' , 'exception ' => $ e ]
145146 );
146147 return ;
@@ -165,7 +166,7 @@ public function write(BeforeNodeWrittenEvent $event): void {
165166 'path ' => mb_substr ($ node ->getInternalPath (), 5 ),
166167 ];
167168 } catch (InvalidPathException |NotFoundException $ e ) {
168- \ OCP \ Server::get (LoggerInterface::class)->error (
169+ Server::get (LoggerInterface::class)->error (
169170 'Exception thrown in file write: ' . $ e ->getMessage (), ['app ' => 'admin_audit ' , 'exception ' => $ e ]
170171 );
171172 return ;
@@ -193,7 +194,7 @@ public function update(NodeWrittenEvent $event): void {
193194 'path ' => mb_substr ($ event ->getNode ()->getInternalPath (), 5 ),
194195 ];
195196 } catch (InvalidPathException |NotFoundException $ e ) {
196- \ OCP \ Server::get (LoggerInterface::class)->error (
197+ Server::get (LoggerInterface::class)->error (
197198 'Exception thrown in file update: ' . $ e ->getMessage (), ['app ' => 'admin_audit ' , 'exception ' => $ e ]
198199 );
199200 return ;
@@ -217,7 +218,7 @@ public function delete(NodeDeletedEvent $event): void {
217218 'path ' => mb_substr ($ event ->getNode ()->getInternalPath (), 5 ),
218219 ];
219220 } catch (InvalidPathException |NotFoundException $ e ) {
220- \ OCP \ Server::get (LoggerInterface::class)->error (
221+ Server::get (LoggerInterface::class)->error (
221222 'Exception thrown in file delete: ' . $ e ->getMessage (), ['app ' => 'admin_audit ' , 'exception ' => $ e ]
222223 );
223224 return ;
0 commit comments