GithubHelp home page GithubHelp logo

calendon's People

Contributors

pyjarrett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

meowboy326

calendon's Issues

Logging: Add conditional logging macros.

Purpose

Extend the logging system to allow logging which doesn't trigger on every line hit.

Method

Extend the logging system to include conditional logging variations of the existing CN_ERROR, CN_WARN and CN_TRACE macros to include these variations:

  • *_IF(condition, msg, ...) - only log if the given condition is met
  • *_EVERY(num, msg, ...) - only log every num times this log line is encountered
  • *_ONCE(msg, ...) - only log the first time this log line is encountered

Logging: Add logging to file.

Purpose

Improve logging by allowing output to be redirected to a named file.

Method

  • Include a --log-file PATH to the command line parameters.
  • If a logfile is specified, no logging output should be sent to stderr or stdout, unless --log-console is also specified.

Logging: Add current program time to log output

Purpose

Be able to identify when log messages are written to the log.

Method

Provide a "current runtime" timestamp in the log output:

Maybe something like:

// log.h
	cnLog_Print(system, verbosity, \
		"%15s %c: %40s:%i %15s SYS_%-10s: " msg " \n", \
		formattedTimeStamp,                            \
		LogVerbosityChar[verbosity], \
		__FILE__, __LINE__, \
		LogSystemsRegistered[system], \
		##__VA_ARGS__ \
		);
  • cnTime_Init should initialize the reference time
  • Provide a function to format the current time into a fixed-width "hours:minutes:seconds.microseconds"

Crank: Limit header file exports to those files which must be exported.

Purpose

Reduce the number of header files exported to only those required for library usage.

Method

  • Include a special empty macros to identify these headers, which gets checked against usage of CN_API to detect headers which should be exported, but are not.

For public header files which should be exported:

#define CN_EXPORT_HEADER

For header files which should not be exported:

#define CN_PRIVATE_HEADER

crank should issue an error during export and abort if CN_API exists in a private header.

  • Modify the export command in crank to only copy public headers to the exported library location.

Crank: Add header files checks to `export` in Crank

Purpose

Perform checks during header file export to ensure header files can be properly used.

Method

Crank should perform checks of header files contents when the export command is used:

C++ interoperability

Verfiy usage of this block:

#ifdef __cplusplus
extern "C" {
#endif

Header guard (or pragma)

First lines should be:

#pragma once
#ifndef <FILE>_H
#define <FILE>_H

Last line should be:

#endif /* <FILE>_H */

File export visibility

See #1

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.