Coder Social home page Coder Social logo

logger's Introduction

Hi, I'm Artyom


I am a first-year student at MIPT. I have been programming for three years and I try something new all the time. Managed to gain experience in system programming in Huawei and ISP RAS. I am also learning Web Backend Development while leading a team, which is developing StudOko Web application in Kotlin for ATP department at MIPT.

Currently developing several projects and working in ISP RAS over a static analyzer Svace by Samsung.

My CV is here.

Contact me on social media


LinkedIn LinkedIn | LinkedIn Telegram | LinkedIn Email

More stuff about me

What I'm currently learning


Now, I study Data Flow Analysis (DFA) at work and the Rust language in my free time.

Projects


  • [C++] sql2cypher is a unique tool, which allows you to translate your queries when migrating from RDBMS (Microsoft SQL Server) into GDBMS (Neo4j).

  • [C++] logger is a very lightweight, flexible, simple and universal logger for C++ projects. It supports different formats (in e.g. json), colors, can write logs in some places (files, stdout) and so on.

  • [Kotlin] StudOko is a web application that will allow the Department of ATP at the MIPT to issue and accept homework for students, control access to a server cluster and department's GitLab.

Skills


  • Languages: Java, C/C++, Kotlin and a little bit Python, Ruby, Go
  • DBMS: Microsoft SQL Server, Neo4j
  • DevOps: Linux, Git and a little bit Docker, CI/CD
  • Agile: Scrum & Kanban in Jira

See more in my CV.

logger's People

Contributors

cann3v avatar temikfart avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

cann3v

logger's Issues

Warnings during compilations

During compilation as is or in project, there are a lot of warnings (if I included log.h) with the following messages:

In file included from /path/to/logger/log.hpp:5:
In file included from /path/to/logger/logger.hpp:7:
/path/to/logger/appenders/appender_interface.hpp:19:55: warning: field 'appender_type_' will be initialized after field 'severity_' [-Wreorder-ctor]
    IAppender(AppenderType type, Severity severity) : appender_type_(type), severity_(severity) {}
                                                      ^~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~
                                                      severity_(severity)   appender_type_(type)
/path/to/logger/appenders/appender_interface.hpp:24:39: warning: unused parameter 'severity' [-Wunused-parameter]
    virtual void set_colours(Severity severity, const MessageColours& msg_cols) {}
                                      ^
/path/to/logger/appenders/appender_interface.hpp:24:71: warning: unused parameter 'msg_cols' [-Wunused-parameter]
    virtual void set_colours(Severity severity, const MessageColours& msg_cols) {}

Add -Werror flag for compilation.

Bad conversion from string severity representation to enum

The functions to_severity(const std::string&) and to_string(const Severity) do conversion in bad way, because any string, that starts with correct letter will be parsed as valid Severity. I think, to_severity should throw an exception, if passed argument is incorrect.

FileAppender with append mode

The std::ios::app mode in FileAppender doesn't work as intended: after running the program, the logger creates a new file with the current timestamp and writes events there.
But std::ios::app mode implies writing to the end of an existing file.

New feature: log rotation

It would be cool to add log rotation feature. In some cases, when log files become too large (or irrelevant), they need to be compressed/moved/deleted/something else.
So you can add some optional arguments to logger::init, for example:

  • logger::init(logger::debug, logger::cout, "500 MB") for rotation big files;
  • logger::init(logger::debug, logger::cout, "12:00") for rotation every noon;
  • logger::init(logger::debug, logger::cout, "10 days") for retention old files;
  • logger::init(logger::debug, logger::cout, "zip") for compression.

Logs after program execution

Logs are written to the file only after successful program execution (not in real time).
For example:

logger::init(logger::debug, "../log");
LOGI << "Test info";

int t;
std::cout << "waiting... ";
std::cin >> t;
$ ./my_program
waiting...

In another tab check log file:

$ cat log/2023-03-31-14-28-13.log
$

As you can see, log file is empty, although LOGI << was executed.

logger::init cause Segmentation Fault

  • logger::init(logger::debug, "log")
  • logger::init(logger::debug, "log/")

cause SIGSEGV in utils.hpp:115.
GDB output:

logger::utils::maybe_regular_file (path=filesystem::path L"\154\157", <incomplete sequence \147>) at include/logger/utils.hpp:115
115	    return (str[length - 1] == '.');

Varriables:

path = {const std::filesystem::__cxx11::path &}
str = {std::string} "log"

Tested on Windows 11 x64_86 with MinGW

logger::init(logger::debug, "log\\") doesn't create any file, but works without SIGSEGV

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.