- Create a local logging system
- write log into disk files
- set max size for each log file
- log rotate
- keep the log file in a safe disk place where only chrome can access, and provide ways to move it to real folder
- Recording a web meeting locally
- write recorded stream into disk file
- add multiple audio stream, mix it and write to file
npm install disk-file-writer
import FileLogger from 'disk-file-writer';
then we have the UI:
- choose where to store files
choose where to store file button will open the system folder, this is where you choose your root folder to store all the log files and video recording files.
- local recoding
when you have choose the folder to store file, the
choose where to store file button will be removed, then you can click the
start recording button, thre browser will ask to select a window/screen/browser tab to record.
the default sub-folder to store recording file is
zoomvideos, so you can find the recording here:
- debugging log
sometimes we want to open log file and see it updating in real time. we can doing it by simply click the
why don't we open the
real-time log.txt ? because the file is being open and close every 1s, so we can't see the updated the file content if we keep the file open.
so we have to utilize some tools to see it:
- in mac, we use
tail -F path_to_file
- in windows, we use
Get-Content path_to_file -Wait -Tail 10
- request permission
we store the root directory handle in indexedDB, so you don't have to re-select the directory handle after page refreshment
but that doesn't mean we can use the file handle from indexedDB directly, we need the browser to grant permission of read-write after page refreshment.