
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@sobujch/textlog
Advanced tools
This repository contains a simple logging utility for Node.js applications. It provides functions to log messages to the console and to a file, with options for custom log file names and directories. Each log message is appended with the current date and time.
Log messages to the console with date and time. Log messages to a file. Customizable log file names and directories. Timestamps for each log entry. Option to log with or without colors.
npm i @sobujch/textlog
const { setName, setDir, log, debuglog } = require('./index');
You can set a custom log file name using the setName
function:
await setName('custom-log-file-name');
You can set a custom log directory using the setDir
function. By default, the directory is relative to the current directory:
await setDir('logs');
To set an absolute directory, pass false
as the second argument:
await setDir('/absolute/path/to/logs', false);
To log messages to the console and the log file, use the log
function:
await log('This is a log message', { key: 'value' });
To log messages only to the log file, use the debuglog
function:
await debuglog('This is a debug log message', { key: 'value' });
setName(name)
Sets the name of the log file.
name
(string): The name of the log file.setDir(dir, relative = true)
Sets the directory for the log files.
dir
(string): The directory for the log files.relative
(boolean): Whether the directory is relative to the current directory. Default is true
.log(...txt)
Logs messages to the console and the log file, appending the current date and time.
...txt
(any): The messages to log.debuglog(...txt)
Logs messages only to the log file, appending the current date and time.
...txt
(any): The messages to log.This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any changes or improvements.
For any questions or inquiries, please contact [your-email@example.com].
FAQs
Log text in console and file with timestamp.
We found that @sobujch/textlog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.