Skip to content

Instantly share code, notes, and snippets.

@MiguelCastillo
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiguelCastillo/3c83c83159b5af2ec5a2 to your computer and use it in GitHub Desktop.
Save MiguelCastillo/3c83c83159b5af2ec5a2 to your computer and use it in GitHub Desktop.
sample default Logger stream and serializer
Bitloader.Logger.default.enable();
Bitloader.Logger.default.stream = {
write: function(buffer) {
console.log(buffer);
}
};
Bitloader.Logger.default.serialize = function(packet) {
return JSON.stringify({
name: packet.name,
hostname: "localhost",
pid: 1,
level: 3,
msg: JSON.stringify(packet.data),
time: packet.date,
v: 0
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment