Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LudimoodleTraceTransformer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stuart Hallifax
LudimoodleTraceTransformer
Commits
aa59f1fe
Commit
aa59f1fe
authored
6 years ago
by
Stuart Hallifax
Browse files
Options
Downloads
Patches
Plain Diff
Added code base
parents
Branches
main
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FileWatcher.py
+28
-0
28 additions, 0 deletions
FileWatcher.py
with
28 additions
and
0 deletions
FileWatcher.py
0 → 100644
+
28
−
0
View file @
aa59f1fe
import
sys
import
time
import
logging
from
watchdog.observers
import
Observer
from
watchdog.events
import
LoggingEventHandler
from
ReadFileHandler
import
FileReaderHandler
if
__name__
==
"
__main__
"
:
logging
.
basicConfig
(
level
=
logging
.
INFO
,
format
=
'
%(asctime)s - %(message)s
'
,
datefmt
=
'
%Y-%m-%d %H:%M:%S
'
)
# path = sys.argv[1] if len(sys.argv) > 1 else '.'
path
=
"
../FakeLogGenerator/
"
print
(
path
)
# event_handler = LoggingEventHandler()
event_handler
=
FileReaderHandler
()
observer
=
Observer
()
observer
.
schedule
(
event_handler
,
path
,
recursive
=
True
)
observer
.
start
()
try
:
while
True
:
time
.
sleep
(
1
)
except
KeyboardInterrupt
:
observer
.
stop
()
observer
.
join
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment