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-logger
to start with default color mode (bright
); - run
tool-socketio-logger --color dark
to start with color modedark
, if you're using black background in your terminal - use
--port
or-p
to specify the port your should like to use.
- check out the project
- run
npm i
to initialise the project - run
npm start
to start with default color mode (bright
) - run
npm run start-dark
to 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>