A simple as-it-is message logger powered by socket.io
npm i -g git+https://[email protected]/unknownmoon/tool-socketio-logger.git- run
tool-socketio-loggerto start with default color mode (bright); - run
tool-socketio-logger --color darkto start with color modedark, if you're using black background in your terminal - use
--portor-pto specify the port your should like to use.
- check out the project
- run
npm ito initialise the project - run
npm startto start with default color mode (bright) - run
npm run start-darkto start with color modedark, if you're using black background in your terminal
The API is /api/v0/socket-inject/, while the query func is the global function to communicate with the logger.
In the example below, __debug and __log are registered to the logger, with differently coloured outputs.
<script src="http://localhost:9528/api/v0/socket-inject?func=__debug&func=__log"></script>
<scirpt>
// how to use the client logging functions
__debug(location);
__log(location);
</scirpt>Newly add from in query, for providing an id other than the random socket id. (Note that socket id will be used if from is ommitted.)
<script src="http://localhost:9528/api/v0/socket-inject?func=__debug&func=__log&from=alice"></script>
<scirpt>
// how to use the client logging functions
__debug(location);
__log(location);
</scirpt>